Skip to main content
// glossary

The terms behind the problems.

Plain, accurate definitions for the algorithms, data structures, and interview vocabulary you run into every day. No filler, no hand-waving. Each entry links to a deeper guide where one exists.

Complexity & analysis

How we talk about the cost of an algorithm before we run it.

Big O notation
A way to describe how an algorithm's running time or memory grows as the input gets larger, ignoring constant factors and lower-order terms. O(n) grows linearly with input size, O(log n) grows slowly, and O(n^2) grows quadratically. Read the guide
Time complexity
How the number of operations an algorithm performs scales with the size of its input, usually stated in Big O notation. It answers how much slower a solution gets as n grows, not how many milliseconds it takes on a given machine. Read the guide
Space complexity
How much extra memory an algorithm needs as its input grows, again expressed in Big O notation. It counts the working memory the algorithm allocates, separate from the space already taken by the input itself.
Amortized analysis
Measuring the average cost of an operation across a long sequence of calls rather than the worst case of a single call. A dynamic array push is O(n) on the rare resize but O(1) amortized, because each resize is spread across many cheap pushes.

Techniques & paradigms

The core patterns that turn a brute-force idea into an efficient solution.

Recursion
A function that solves a problem by calling itself on smaller inputs until it reaches a base case that returns directly. It trades an explicit loop for the call stack, which makes tree and divide-and-conquer problems natural to express.
Dynamic programming
Solving a problem by breaking it into overlapping subproblems and storing each subproblem's answer so it is computed only once. It applies when a problem has optimal substructure, and it turns exponential brute force into polynomial time. Read the guide
Memoization
Caching the result of a function call keyed by its arguments so repeated calls return instantly instead of recomputing. It is the top-down form of dynamic programming, where recursion fills the cache on demand. Read the guide
Greedy algorithm
An approach that builds a solution step by step, always taking the choice that looks best right now and never reconsidering. It is fast and simple, but it only produces an optimal answer when the problem has the right structure, proven by an exchange argument.
Divide and conquer
Splitting a problem into independent subproblems, solving each recursively, then combining the results. Merge sort and quicksort are the classic examples, and the pattern often yields O(n log n) running times.
Backtracking
A search that builds candidates incrementally and abandons a partial candidate the moment it cannot lead to a valid solution. It is the standard tool for constraint problems like Sudoku, N-queens, and generating permutations. Read the guide
Two pointers
Walking two indices through a sequence and moving them based on a condition to avoid a nested loop. It is common on sorted arrays and linked lists for pair sums, removing duplicates, and detecting cycles. Read the guide
Sliding window
Maintaining a contiguous range over an array or string and moving its edges to track a running quantity, so each element is visited a constant number of times. It turns many O(n^2) subarray and substring problems into O(n). Read the guide
DFS (depth-first search)
A graph or tree traversal that follows one path as far as it can before backing up and trying the next branch, using recursion or an explicit stack. It powers connectivity checks, cycle detection, topological sort, and enumerating all paths. Read the guide
BFS (breadth-first search)
A traversal that visits every node at the current distance before moving one step farther, using a queue. On an unweighted graph it finds the shortest path measured in number of edges. Read the guide

Data structures

The containers that decide how fast your operations can be.

Hash map
A structure that maps keys to values using a hash function, giving average O(1) lookup, insertion, and deletion. It is the default tool for counting, deduplicating, and fast membership checks.
Heap / priority queue
A structure that always gives quick access to the smallest or largest element, with O(log n) insertion and removal. A priority queue is the abstract pull-the-highest-priority-item interface, and a binary heap is the usual way to implement it. Read the guide
Stack
A last-in, first-out collection where you add and remove from the same end. It backs function calls, expression parsing, undo history, and iterative DFS.
Queue
A first-in, first-out collection where you add at one end and remove from the other. It backs BFS, scheduling, and any workload that must be processed in arrival order.
Linked list
A linear structure where each node holds a value and a pointer to the next node, so elements are not stored contiguously in memory. Insertion and deletion at a known position are O(1), but reaching the k-th element takes O(k).
Tree
A hierarchical structure of nodes with a single root, where each node has children and there are no cycles. Binary search trees, heaps, and tries are common variants for ordered data, priority access, and prefix lookups. Read the guide
Graph
A set of nodes connected by edges that may be directed or weighted. Graphs model networks, dependencies, maps, and relationships, and most graph problems reduce to some form of traversal or shortest path. Read the guide

Practice & interviews

The arenas where the terms above actually get tested.

Competitive programming
A sport where participants solve well-defined algorithmic problems under a time limit, with solutions judged automatically on correctness and speed against hidden test cases. It builds pattern recognition and the habit of reasoning about complexity under pressure. Read the guide
Technical interview
A hiring conversation where a candidate solves coding and problem-solving tasks, often live, while explaining their reasoning. Modern versions increasingly test system design and how well someone works with AI tools, not just whether they can reproduce a textbook algorithm. Read the guide

Stop reading definitions. Start solving.

Every term here shows up in ranked battles and practice on AlgoArena. Pick a problem and put one to work.