Data Structures and Algorithms
Data Structures and Algorithms
Lists: Dynamic arrays.
append, insert, remove, sort
Tuples: Immutable sequences.
Packing, unpacking
Page 1
Data Structures and Algorithms
Page 2
Dictionaries: Key-value pairs.
keys, values, items, get
Sets: Unordered unique elements.
add, remove, union, intersection
Stacks: LIFO structure.
append, pop
Page 2
Data Structures and Algorithms
Page 3
Queues: FIFO structure.
[Link]
Linked Lists: Node-based.
Custom implementation
Trees: Hierarchical structure.
Binary trees, traversals
Page 3
Data Structures and Algorithms
Page 4
Graphs: Nodes and edges.
Adjacency lists, DFS, BFS
Sorting: Quick, merge, bubble.
sorted(), sort()
Searching: Linear, binary.
in operator, bisect
Hashing: Dictionary implementation.
hash() function
Page 4
Data Structures and Algorithms
Page 5