Algorithms Intermediate
Arrays, hash tables, trees, and recursion — the core data structures and patterns you need to solve coding problems efficiently.
Curriculum (20 steps)
What Is an Algorithm?
articlesA precise, step-by-step procedure for solving a problem or completing a task, illustrated with pseudocode and real-world analogies.
Why array indexing is O(1), how the CPU computes element addresses, and what spatial locality means for performance.
Visualize how contiguous array memory enables cache-friendly access while scattered linked list nodes cause pointer-chase cache misses.
Trace an Array Insertion
tracesFollow an array insertion from capacity check through resize, element shift, and write, showing why middle insertion is O(n).
Trace a Linear Search
tracesFollow a linear search across 10 array elements, checking each one until the target is found or the array is exhausted.
How a function can solve a problem by delegating a smaller version of the same problem to itself, the call stack, and common pitfalls.
Follow factorial(5) from the initial call through five stack frames, the base case at factorial(0), and the return unwinding that produces 120.
Follow the key state changes and boundary checks involved in a practical method for analyzing algorithms.
Follow the key state changes and boundary checks involved in arrays and linked lists: cost follows access pattern.
An interactive concept flow for arrays and linked lists: cost follows access pattern, from its assumptions through the main operation and boundary checks.
Contains Duplicate
practiceDecide whether any value occurs more than once, and compare a set-based solution with sorting the input.
A hash table transforms a key into a hash value and uses part of that value to select a bucket or slot.
Follow the key state changes and boundary checks involved in hash tables: from keys to buckets.
An interactive concept flow for hash tables: from keys to buckets, from its assumptions through the main operation and boundary checks.
Follow the key state changes and boundary checks involved in trees and heaps solve different ordering problems.