Graph traversal, hash tables and core algorithms
A graph is a set of vertices and edges stored either as an adjacency matrix using O(V^2) space or as an adjacency list that is efficient for sparse graphs. BFS explores level by level using a queue, while DFS goes as deep as possible using recursion or a stack.
A hash table maps a key to an index through a hash function, giving average O(1) insertion and lookup. Collisions, where two keys map to the same slot, are resolved by chaining or open addressing.
Binary search finds an element in O(log n) on sorted data, while merge sort and quick sort sort in O(n log n) and the simpler bubble and insertion sorts run in O(n^2).
This final unit covered graph representations and traversals, hashing for fast lookup, and the comparison of common sorting and searching algorithms by their time complexity.