Browse Topics
25 topics. Click "Study" to add to your review queue.
Backtracking
Systematically explore all possible solutions by building candidates and abandoning them when they fail constraints
BFS (Breadth-First Search)
Explore a tree level by level using a queue
Binary Search
Efficiently find a target in a sorted collection by repeatedly halving the search space
Binary Search Tree
A binary tree where left children are smaller and right children are larger, enabling fast lookup
Counting Sort
Sort integers by counting occurrences of each value — no comparisons needed
Cycle Detection
Detect if a linked list contains a cycle using Floyd's tortoise and hare algorithm
DFS (Depth-First Search)
Explore a tree by going as deep as possible before backtracking
Dijkstra's Algorithm
Find the shortest path from a source to all other nodes in a weighted graph with non-negative edges
Fibonacci DP
Compute Fibonacci numbers efficiently using memoization or tabulation to avoid redundant work
Graph BFS
Explore a graph layer by layer to find shortest paths in unweighted graphs
Graph DFS
Explore a graph by going as deep as possible along each branch before backtracking
Heap Sort
Build a max-heap from the array, then repeatedly extract the maximum to sort
Kadane's Algorithm
Find the maximum sum contiguous subarray in a single pass
Knapsack
Maximize value by selecting items with weight constraints using dynamic programming
Linked List Reversal
Reverse the direction of pointers in a linked list
Merge Sort
Divide the array in half, sort each half, then merge the sorted halves
Merge Two Sorted Lists
Combine two sorted linked lists into one sorted list by rewiring pointers
Monotonic Stack
Maintain a stack where elements are always in increasing or decreasing order to find next greater/smaller elements efficiently
Prefix Sum
Precompute cumulative sums to answer range-sum queries in constant time
Quick Sort
Pick a pivot, partition elements around it, and recursively sort each side
Sliding Window
Maintain a window over a contiguous subarray and slide it across to track running computations
Topological Sort
Order vertices of a DAG so every edge goes from earlier to later in the ordering
Trie
A prefix tree that stores strings character by character for fast prefix lookups
Two Pointers
Use two indices moving through an array to solve problems in a single pass
Union-Find
Track disjoint sets with near-constant-time union and find operations