1. Searching and Sorting Foundations
This chapter covers the essential searching and sorting algorithms that form the backbone of algorithmic problem solving. Binary Search is the cornerstone searching technique on so...
Read full chapter →The essential Algorithms Code cheat sheet: 7 concise chapters you can read in minutes, distilled from the full deck. When you're ready, drill the flashcards or test yourself under exam conditions.
This chapter covers the essential searching and sorting algorithms that form the backbone of algorithmic problem solving. Binary Search is the cornerstone searching technique on so...
Read full chapter →Several powerful techniques transform seemingly complex array problems into elegant linear-time solutions. The Two Pointers technique uses two indices moving toward each other or i...
Read full chapter →Binary trees and Binary Search Trees (BSTs) form the foundation of hierarchical data structures. A BST maintains the invariant that left children are less than the parent and right...
Read full chapter →Graph traversal forms the basis of countless algorithms. Breadth-First Search (BFS) explores level by level using a queue, making it ideal for shortest path in unweighted graphs, l...
Read full chapter →Dynamic Programming solves problems by breaking them into overlapping subproblems and storing results to avoid recomputation. The Fibonacci example illustrates both approaches: top...
Read full chapter →The heap (priority queue) is a complete binary tree maintaining the heap property. Min-heaps support O(log n) insert and extract-min, with O(1) peek. Python's heapq module implemen...
Read full chapter →String matching algorithms efficiently find patterns within text. The naive approach runs in O(n × m), but sophisticated algorithms achieve linear or near-linear time. KMP (Knuth-M...
Read full chapter →Done reading?
Test yourself with the Algorithms Code practice exam — timed questions, instant score, full review of wrong answers. Free.
🎯 Take the Practice Exam →