Data Structures & Algorithms

Fundamental algorithms and data structures through math-first learning.

SearchO(log n)

Binary Search

Efficiently find an element in a sorted array by halving the search space each step.

SortingO(n log n)

Merge Sort

Divide-and-conquer sorting that recursively splits and merges sorted subarrays.

GraphsO(V + E)

Graph BFS

Explore a graph layer by layer to find shortest paths in unweighted graphs.

SortingO(n log n)

Quick Sort

Partition-based sorting that picks a pivot and recursively sorts subarrays in-place.

GraphsO(V + E)

Graph DFS

Traverse a graph by exploring as deep as possible before backtracking.

GraphsO((V + E) log V)

Dijkstra's Algorithm

Find shortest paths from a source vertex in a weighted graph with non-negative edges.

Data StructuresO(1) avg

Hash Table

Map keys to values using a hash function for constant-time average lookups and inserts.

TreesO(log n)

Binary Search Tree

A rooted binary tree where each node's left subtree has smaller keys and right subtree has larger keys.

Data StructuresO(log n)

Heap & Priority Queue

A complete binary tree satisfying the heap property, enabling efficient min/max extraction.

OptimizationVaries

Dynamic Programming

Solve complex problems by breaking them into overlapping subproblems and caching results.

GraphsO((V + E) log V)

A* Search

Pathfinding with heuristic guidance — combines Dijkstra's optimality with greedy best-first speed.

GraphsO(V + E)

Topological Sort

Order vertices of a directed acyclic graph so every edge goes from earlier to later in the ordering.

Data StructuresO(α(n))

Union-Find (Disjoint Set)

Efficiently track and merge disjoint sets using union by rank and path compression.

Data StructuresO(m)

Trie (Prefix Tree)

A tree-shaped data structure for efficient string storage, search, and prefix matching.

SortingO(n²)

Insertion Sort

Build a sorted array one element at a time by inserting each into its correct position.