DATA STRUCTURES AND
ALGORITHMS PYTHON
Name Every Data Structure (There are 8 Main Ones) - Correct Answers -1. Array
2. Stack
3. Queue
4. Linked Lists
5. Hash Table
6. BST
7. B-Tree, Red Black Trees
8. Heaps
Name Every Python Super Basic Datastructure - Correct Answers -1. List
2. Tuples
3. Sets
4. Strings
5. Arrays (you must use numpy)
Strings - Correct Answers -1. They are immutable
2. Access characters in strings like you do for arrays/lists
3. empty strings are false, non empty are true.
4. | and & don't work on strings
Slicing - Correct Answers -string_name[beginning:end:step]
*end is not inclusive
*works for strings, lists, and tuples
Useful String Methods - Correct Answers -1. s[3]
2. s + t
3. len(s)
4. s in t
5. s.strip()
6. s.startswith(prefix)
7. s.endswith(suffix)
8. s.find(substring, beg, end) - returns the first position where substring is found.
9. s.rfind(substring, beg,end) - returns the position of the last occurrence of string
10. s.lower() - changes case
11. s.upper() - changes case
12. s.swapcase() - changes to other case
Python List - Correct Answers -1. not always homogenous