CodeType Curriculum
Practice the full algorithm curriculum.
Browse by difficulty, search by name, and jump into code in any of the six supported languages.
Coverage
51 topics
Easy to expert, all searchable.
Filters
Difficulty + category
Languages
TS, JS, Java, C#, Python, C
Search the curriculum
easy
7 topicsSearching
Binary Search
Search a sorted array by halving the range.
Runtime: O(log n)
Sorting
Bubble Sort
Swap adjacent out-of-order elements.
Runtime: O(n^2)
Data Structures
Hash Table (Basic)
Basic key-value storage.
Runtime: O(1) avg
Sorting
Insertion Sort
Insert each element into its sorted position.
Runtime: O(n^2)
Searching
Linear Search
Scan each element until the target is found.
Runtime: O(n)
Sorting
Selection Sort
Select the smallest remaining element each pass.
Runtime: O(n^2)
Data Structures
Stack / Queue Operations
Basic LIFO/FIFO operations.
Runtime: O(1)
medium
9 topicsGreedy
Activity Selection
Select max non-overlapping activities.
Runtime: O(n log n)
Graphs
Breadth-First Search (BFS)
Traverse graph level by level.
Runtime: O(V + E)
Data Structures
Binary Search Tree (BST)
Insert, search, and delete in a BST.
Runtime: O(log n) avg
Graphs
Depth-First Search (DFS)
Traverse graph by exploring depth first.
Runtime: O(V + E)
Dynamic Programming
Fibonacci DP
Compute Fibonacci with memoization or tabulation.
Runtime: O(n)
Sorting
Heap Sort
Use a heap to repeatedly extract max.
Runtime: O(n log n)
Sorting
Merge Sort
Divide array, sort recursively, then merge.
Runtime: O(n log n)
Sorting
Quick Sort
Partition around a pivot, then recurse.
Runtime: O(n log n) avg
Strings
Trie Operations
Insert and search prefixes in a trie.
Runtime: O(m)
hard
20 topicsData Structures
Balanced Trees (AVL)
Keep tree height logarithmic with rotations.
Runtime: O(log n)
Graphs
Bellman-Ford
Shortest paths with negative edges.
Runtime: O(VE)
Computational Geometry
Convex Hull (Graham Scan)
Compute hull of points in O(n log n).
Runtime: O(n log n)
Graphs
Dijkstra's Algorithm
Shortest paths with non-negative weights.
Runtime: O((V + E) log V)
Network Flow
Dinic's Algorithm
Level graph + blocking flows for max flow.
Runtime: O(E sqrt V)
Advanced Data Structures
Disjoint Set Union (Union-Find)
Union and find with path compression.
Runtime: O(alpha(n))
Network Flow
Edmonds-Karp
BFS-based Ford-Fulkerson.
Runtime: O(VE^2)
Advanced Data Structures
Fenwick Tree (BIT)
Prefix sums with log-time updates.
Runtime: O(log n)
Graphs
Floyd-Warshall
All-pairs shortest paths.
Runtime: O(V^3)
Network Flow
Ford-Fulkerson
Max flow using augmenting paths.
Runtime: O(E * maxflow)
Greedy
Huffman Coding
Build optimal prefix codes for compression.
Runtime: O(n log n)
Strings
Knuth-Morris-Pratt (KMP)
Pattern matching with prefix table.
Runtime: O(n + m)
Dynamic Programming
Knapsack (0/1)
Max value under a weight capacity.
Runtime: O(nW)
Graphs
Kruskal's Algorithm
Minimum spanning tree using sorted edges.
Runtime: O(E log E)
Dynamic Programming
Longest Common Subsequence (LCS)
Find the longest subsequence common to two strings.
Runtime: O(nm)
Computational Geometry
Line Sweep
Process events in sorted order.
Runtime: O(n log n)
Graphs
Prim's Algorithm
Minimum spanning tree from a start node.
Runtime: O(E log V)
Strings
Rabin-Karp
Hash-based string matching.
Runtime: O(n + m) avg
Advanced Data Structures
Segment Tree
Range query and update in log time.
Runtime: O(log n)
Advanced Data Structures
Suffix Array
Sorted suffix indices for fast string queries.
Runtime: O(n log n)
expert
15 topicsApproximation
Approximation Algorithms
Near-optimal solutions for NP-hard problems.
Runtime: Varies
Complexity
Circuit Complexity
Lower bounds for Boolean circuits.
Runtime: N/A
Streaming
Count-Min Sketch
Approximate frequency counting.
Runtime: O(1)
Machine Learning
EM Algorithm
Expectation-Maximization for latent variables.
Runtime: O(nk)
Complexity
Fine-Grained Complexity
Hardness under conjectures like SETH.
Runtime: N/A
Randomized
Las Vegas Algorithms
Always correct with random runtime.
Runtime: Expected poly
Parallel
MapReduce Algorithms
Map and reduce for large-scale data.
Runtime: Varies
Streaming
Misra-Gries
Find heavy hitters in a stream.
Runtime: O(n)
Randomized
Monte Carlo Algorithms
Probabilistic algorithms with bounded error.
Runtime: Varies
Complexity
NP-Complete Problems
Canonical NP-complete problems and reductions.
Runtime: Exponential
Complexity
P vs NP (Theory)
Polynomial-time solvable vs verifiable problems.
Runtime: N/A
Complexity
PCP Theorem
Hardness of approximation via probabilistic proof checking.
Runtime: N/A
Parallel
PRAM Prefix Sum
Parallel prefix sum model.
Runtime: O(log n)
Randomized
Randomized Quicksort
Random pivot to avoid worst-case inputs.
Runtime: O(n log n) expected
Machine Learning
Stochastic Gradient Descent (SGD)
Iterative optimization for model parameters.
Runtime: O(d)