Learning track
Data Structures & Algorithms
Think in structures. Reason in steps.
From Big-O to dynamic programming: every core data structure and algorithm, animated step by step with implementations in four languages.
Foundations
The language of efficiency
How to measure algorithms, reason about growth, think recursively and manipulate bits: the toolkit every later topic relies on.
Introduction to DSA
What data structures and algorithms are, why they matter, and how to study them effectively.
Big-O Notation
Describe how running time and memory grow with input size using O, Ω and Θ.
Time & Space Complexity Analysis
Analyze loops, recursion and amortized operations; solve recurrences with the Master Theorem.
Recursion
Solve problems by defining them in terms of smaller instances of themselves: base cases, call stacks and recursion trees.
Bit Manipulation
AND, OR, XOR, shifts and the classic bit tricks for sets, parity and powers of two.
Math for DSA
Primes and the Sieve of Eratosthenes, GCD/LCM, modular arithmetic, fast exponentiation and combinatorics.
Linear Data Structures
Data in a line
Arrays, strings, linked lists, stacks, queues and hash tables: the workhorses behind almost every program.
Arrays & Dynamic Arrays
Contiguous memory, O(1) indexing, and how dynamic arrays grow with amortized O(1) appends.
Strings
Character encoding, immutability, common operations and the patterns behind string problems.
Linked Lists
Singly, doubly and circular lists: pointer manipulation, insertion, deletion and reversal.
Stacks
Last-in, first-out: the structure behind undo, parsing, recursion and expression evaluation.
Queues & Deques
First-in, first-out queues, circular buffers and double-ended queues.
Hash Tables
Hash functions, collisions, chaining vs open addressing, load factor and resizing.
Searching & Sorting
Order from chaos
Find things fast and put them in order: from linear scans to binary search, and from bubble sort to radix sort.
Linear Search
Scan every element until you find the target: the baseline every search is measured against.
Binary Search
Halve the search space every step: on sorted arrays, on answers, and on monotonic functions.
Bubble Sort
Repeatedly swap adjacent out-of-order pairs until the largest values bubble to the end.
Selection Sort
Select the minimum of the unsorted part and move it to the front, one position at a time.
Insertion Sort
Grow a sorted prefix by inserting each new element into its correct place, like sorting playing cards.
Merge Sort
Divide the array in half, sort each half recursively, then merge: guaranteed O(n log n).
Quick Sort
Partition around a pivot and recurse: the fastest general-purpose sort in practice.
Heap Sort
Build a max-heap, then repeatedly move the maximum to the end: O(n log n) in place.
Counting & Bucket Sort
Beat the O(n log n) comparison bound by counting keys instead of comparing them.
Radix Sort
Sort digit by digit with a stable sub-sort, in O(d·(n + k)).
Trees
Hierarchies & balance
Binary trees, search trees, self-balancing trees, heaps, tries and range-query trees: hierarchical structures that make search fast.
Trees & Binary Trees
Nodes, edges, depth and height: the vocabulary of trees and the shape of binary trees.
Tree Traversals
Pre-order, in-order, post-order and level-order, recursively and iteratively.
Binary Search Trees
Left < node < right: search, insert and delete in O(h), and why height is everything.
AVL Trees
Self-balancing BSTs that keep heights within one using rotations.
Red-Black Trees
Color-based balancing rules that power TreeMap, std::map and the Linux scheduler.
Heaps & Priority Queues
Complete binary trees stored in arrays: O(log n) insert and extract-min, O(n) heapify.
Tries (Prefix Trees)
Store strings character by character for lightning-fast prefix search and autocomplete.
Segment Trees
Answer range queries and point/range updates in O(log n), with lazy propagation.
Fenwick Trees (BIT)
Prefix sums with point updates in O(log n) using the lowest set bit.
B-Trees & B+ Trees
Wide, shallow, disk-friendly trees that power database indexes and file systems.
Graphs
Everything is connected
Model networks, maps and dependencies. Traverse them, find shortest paths, build spanning trees and detect components.
Graph Fundamentals
Vertices, edges, directed vs undirected, weighted graphs, and adjacency list vs matrix.
Breadth-First Search
Explore layer by layer with a queue: shortest paths in unweighted graphs.
Depth-First Search
Go deep before going wide: cycles, connectivity, and the backbone of many graph algorithms.
Topological Sort
Order the vertices of a DAG so every edge points forward: Kahn's algorithm and DFS ordering.
Dijkstra's Algorithm
Single-source shortest paths on non-negative weights with a priority queue.
Bellman-Ford & Floyd-Warshall
Shortest paths with negative edges, negative-cycle detection, and all-pairs shortest paths.
Minimum Spanning Trees
Connect every vertex at minimum cost with Kruskal's and Prim's algorithms.
Union-Find (Disjoint Set)
Track connected components with near-constant-time union and find using path compression.
A* Pathfinding
Heuristic-guided shortest paths: how games and maps find routes fast.
SCCs, Bridges & Articulation Points
Kosaraju's and Tarjan's algorithms, plus finding the critical edges and vertices of a network.
Problem-Solving Patterns
Recognize the pattern, solve the problem
Two pointers, sliding windows, prefix sums, greedy choices and backtracking: reusable patterns that crack most interview problems.
Two Pointers
Walk two indices toward or alongside each other to turn O(n²) scans into O(n).
Sliding Window
Maintain a moving window over a sequence for subarray and substring problems.
Prefix Sums & Difference Arrays
Precompute running totals for O(1) range sums, and difference arrays for O(1) range updates.
Fast & Slow Pointers
Floyd's tortoise and hare: detect cycles, find midpoints and cycle entrances in O(1) space.
Monotonic Stack & Queue
Keep a stack or deque sorted to answer next-greater and sliding-maximum queries in O(n).
Divide & Conquer
Split the problem, solve the parts recursively, combine the answers.
Greedy Algorithms
Make the locally optimal choice at every step, and know when that gives a global optimum.
Backtracking
Systematically explore choices and undo them: permutations, subsets, N-Queens and Sudoku.
Dynamic Programming
Remember the past
Break problems into overlapping subproblems and reuse their answers: memoization, tabulation and the classic DP families.
DP Fundamentals
Overlapping subproblems and optimal substructure: memoization vs tabulation, from Fibonacci up.
Knapsack Problems
0/1, unbounded and bounded knapsack, plus subset sum and coin change.
LCS & Edit Distance
Two-sequence DP: longest common subsequence, edit distance and the diff algorithm.
Longest Increasing Subsequence
The O(n²) DP and the elegant O(n log n) patience-sorting solution.
Grid & Path DP
Unique paths, minimum path sum and dungeon problems on 2D grids.
Advanced DP Patterns
Interval DP, bitmask DP, DP on trees and state-machine DP.
Advanced Topics
Beyond the basics
String matching, probabilistic structures, cache design and the limits of computation.
String Matching (KMP, Rabin-Karp, Z)
Find patterns in text in linear time with failure functions and rolling hashes.
Skip Lists
Layered linked lists with express lanes: probabilistic O(log n) search.
LRU & LFU Cache
Combine a hash map and a doubly linked list for O(1) get and put with eviction.
Complexity Classes: P vs NP
P, NP, NP-complete and NP-hard: what makes some problems fundamentally hard.