Searching Algorithms
Master the fundamental algorithms for finding data, from the efficient Binary Search to graph traversals like BFS and DFS.
Finding Needles in Haystacks
Searching is one of the most common tasks in programming. Imagine looking for a contact in your phone or a file on your computer. Behind the scenes, a searching algorithm is at work. A simple approach is **Linear Search** (checking every single item), but that's slow for big lists. We'll explore smarter, faster ways.
Classic binary search on a sorted array is intern-level and O(log n). The 2026 follow-up is binary search on a predicate: find the first index where a monotonic condition becomes true (minimum capacity, first bad version). BFS is unweighted shortest path / level order — intern/mid on grids. DFS explores; it is not shortest path on unweighted graphs. Weighted graphs belong on the graphs lesson (heap + Dijkstra).