AlgoFrames

Glossary

The computer science terms used in the lessons, in plain words.

adjacency list
A graph representation that stores, for each vertex, a list of its neighbours. It uses O(V + E) memory. Learn: Adjacency matrix, adjacency list, edge list
adjacency matrix
A V × V grid where cell (u, v) records whether, or how heavily, u connects to v. It uses O(V²) memory. Learn: Adjacency matrix, adjacency list, edge list
algorithm
A precise, finite list of steps that solves a problem for every valid input.
amortized
The average cost per operation over a long sequence, so rare expensive operations are spread across many cheap ones.
array
A fixed-size sequence of elements stored side by side in memory, so any element can be reached by its index in constant time. Learn: Arrays: indexing, traversal, insertion and deletion costs
ASCII
A 7-bit code that maps 128 characters, such as letters, digits and punctuation, to the numbers 0 to 127.
asymptotic
Describing how a function behaves as its input grows very large, ignoring constant factors and smaller terms. Learn: Big-O, Big-Θ and Big-Ω
average case
The expected work of an algorithm over a distribution of inputs of a given size.
AVL tree
A self-balancing binary search tree in which the heights of every node’s two subtrees differ by at most one. Learn: AVL trees and rotations
B-tree
A balanced search tree whose nodes hold many keys, keeping the tree shallow. Databases and file systems use it for indexes.
backtracking
Building a solution one choice at a time and undoing the last choice as soon as it cannot lead to a valid answer.
balanced tree
A tree whose height stays O(log n), so searches, inserts and deletes stay fast. Learn: Why balance matters
base case
The input a recursive function answers directly, without calling itself. It stops the recursion. Learn: Recursion: base case, recursive case, the call stack
Bellman-Ford
A shortest-path algorithm that relaxes every edge V − 1 times. It handles negative weights and detects negative cycles. Learn: Bellman-Ford and negative edges
best case
The input of a given size that makes an algorithm do the least work.
BFS
Breadth-first search: explore a graph level by level from a source using a queue, visiting all vertices at distance d before d + 1. Learn: Breadth-first search
Big-O
An upper bound on growth: f(n) is O(g(n)) if f grows no faster than a constant times g for large n. Learn: Big-O, Big-Θ and Big-Ω
Big-Omega
A lower bound on growth: f(n) is Ω(g(n)) if f grows at least as fast as a constant times g for large n. Learn: Big-O, Big-Θ and Big-Ω
Big-Theta
A tight bound on growth: f(n) is Θ(g(n)) if f grows exactly as fast as g, up to constant factors. Learn: Big-O, Big-Θ and Big-Ω
binary heap
A complete binary tree stored in an array in which every parent is ordered before its children, so the top is the minimum or maximum. Learn: Binary heaps: array layout, sift up, sift down
binary search
Searching a sorted array by repeatedly looking at the middle and discarding the half that cannot contain the target. Learn: Binary search
binary search tree
A binary tree where every key in a node’s left subtree is smaller than the node and every key in the right subtree is larger. Learn: BST: search, insert, min and max
binary tree
A tree in which every node has at most two children, called left and right. Learn: Binary trees and how they are stored
bipartite
A graph whose vertices split into two groups so that every edge joins a vertex in one group to a vertex in the other. Learn: Bipartite check by 2-coloring
bit
A binary digit: the smallest unit of data, either 0 or 1. Learn: Bits, bytes and binary numbers
bitmask
An integer whose individual bits are used as on/off flags, for example to record which items of a small set are chosen.
Bloom filter
A compact bit array with k hash functions that answers "definitely not present" or "probably present". It never misses an inserted item.
bucket
One position of a hash table, or one range in bucket sort, that collects the items mapped to it. Learn: Hash tables with separate chaining
byte
A group of 8 bits, able to hold 256 different values. Learn: Bits, bytes and binary numbers
cache
A small, fast store that keeps recently or frequently used data so later requests for it are quicker.
call stack
The stack of frames for the functions currently running. A call pushes a frame with its locals; a return pops it.
child
A node directly below another node in a tree, connected to it by one edge. Learn: Trees: root, leaf, depth, height, subtree
circular buffer
A fixed-size array used as a queue whose head and tail indices wrap around to the start when they pass the end. Learn: Queues: enqueue, dequeue; circular buffer
closure
A function bundled with the variables of the scope where it was created, which it can still use later.
collision
When two different keys hash to the same bucket. Hash tables resolve collisions by chaining or by probing. Learn: Hash functions: from key to bucket index
comparison sort
A sort that orders items only by comparing pairs. No comparison sort can beat Ω(n log n) comparisons in the worst case.
complete tree
A binary tree in which every level is full except possibly the last, which is filled from the left. It fits neatly in an array. Learn: Binary trees and how they are stored
component
A maximal group of vertices in which every vertex can reach every other along edges. Learn: Connected components and flood fill
constant time
Running time that does not grow with the input size, written O(1).
critical section
A part of a program that accesses shared data and must not run in two threads at once.
cryptographic hash
A hash function for which finding two inputs with the same digest, or an input for a given digest, is infeasible.
cycle
A path that starts and ends at the same vertex without repeating edges. Learn: Cycle detection in undirected and directed graphs
DAG
A directed acyclic graph: a directed graph with no cycles. Every DAG has a topological order. Learn: Topological sort: Kahn's algorithm and DFS finishing order
deadlock
A state where threads each hold a resource and wait for one held by another, in a cycle, so none can continue.
depth
The number of edges from the root of a tree down to a node. The root has depth 0. Learn: Trees: root, leaf, depth, height, subtree
deque
A double-ended queue that supports adding and removing items at both the front and the back in constant time.
DFS
Depth-first search: follow one path as far as possible, then backtrack to the most recent vertex with unexplored edges. Learn: Depth-first search
Dijkstra
A shortest-path algorithm for non-negative weights that repeatedly settles the closest unsettled vertex using a priority queue. Learn: Dijkstra's algorithm
directed graph
A graph whose edges have a direction, going from one vertex to another. Learn: Graphs: vertices, edges, directed, weighted, degree, paths
divide and conquer
Splitting a problem into smaller independent parts, solving each recursively, and combining their answers.
DP table
The array or grid that stores the answer to each subproblem in dynamic programming. Learn: Tabulation: filling the table bottom-up
dynamic array
An array that grows automatically by copying into a larger block when full. Doubling the capacity makes appends O(1) amortized. Learn: Dynamic arrays: capacity, growth, amortized append
dynamic programming
Solving a problem by breaking it into overlapping subproblems and storing each answer so it is computed only once. Learn: The DP recipe: state, transition, base cases, order, answer
edge
A connection between two vertices in a graph. It may have a direction and a weight. Learn: Graphs: vertices, edges, directed, weighted, degree, paths
edit distance
The fewest single-character inserts, deletes and replacements needed to turn one string into another. Learn: String DP: LCS, edit distance, palindromic subsequence
exponential time
Running time that multiplies with each extra input element, such as O(2ⁿ). It is only practical for small n.
Fenwick tree
An array-based structure that supports prefix sums and point updates in O(log n), using the lowest set bit of each index.
FIFO
First in, first out: the item that has waited longest leaves first, as in a queue. Learn: Queues: enqueue, dequeue; circular buffer
finite automaton
A machine with a finite set of states that reads input one symbol at a time and accepts or rejects it. Learn: Finite automata: DFA and NFA
floating point
A way of storing real numbers as a sign, exponent and mantissa. Most decimals, like 0.1, are stored only approximately.
Floyd-Warshall
An all-pairs shortest-path algorithm that tries each vertex in turn as an intermediate stop. It runs in O(V³). Learn: Floyd-Warshall: all pairs
frontier
The set of discovered vertices that have not yet been expanded during a graph search. Learn: Breadth-first search
garbage collection
Automatic memory management that frees objects a program can no longer reach.
gradient descent
Repeatedly nudging a model’s parameters in the direction that most reduces its error.
graph
A set of vertices connected by edges. Graphs model maps, networks, dependencies and many puzzles. Learn: Graphs: vertices, edges, directed, weighted, degree, paths
greedy
An approach that makes the best-looking local choice at each step and never revisits it.
hash function
A function that maps a key to a number, used to choose a bucket. Equal keys must always get equal hashes. Learn: Hash functions: from key to bucket index
hash table
A structure that stores keys in buckets chosen by a hash function, giving average O(1) insert, lookup and delete. Learn: Hash tables with separate chaining
heap
A tree-shaped structure in which every parent is ordered before its children, giving fast access to the minimum or maximum. Learn: Binary heaps: array layout, sift up, sift down
height
The number of edges on the longest path from a node down to a leaf. The height of a tree is the height of its root. Learn: Trees: root, leaf, depth, height, subtree
heuristic
A rule of thumb that usually gives a good answer or estimate quickly, without a guarantee of being best. Learn: A* search with heuristics
hexadecimal
Base-16 notation using digits 0–9 and A–F. One hex digit stands for exactly four bits.
in-order
A tree traversal that visits the left subtree, then the node, then the right subtree. On a BST it gives sorted order. Learn: Pre-order, in-order, post-order
in-place
An algorithm that rearranges data inside its input using only O(1) or O(log n) extra memory.
invariant
A condition that holds before and after every iteration of a loop. It is the key to proving a loop correct.
inversion
A pair of positions i < j where a[i] > a[j]. A sorted array has zero inversions.
KMP
Knuth-Morris-Pratt: a string search that uses a prefix table so it never re-examines text characters, running in O(n + m).
Kruskal
A minimum spanning tree algorithm that adds edges from cheapest to most expensive, skipping any edge that would form a cycle. Learn: Kruskal's algorithm
leaf
A tree node with no children. Learn: Trees: root, leaf, depth, height, subtree
level order
A tree traversal that visits nodes one depth at a time, from left to right, using a queue. Learn: Level-order traversal
LIFO
Last in, first out: the most recently added item leaves first, as in a stack. Learn: Stacks: push, pop, peek; array and linked implementations
linear time
Running time proportional to the input size, written O(n).
linked list
A sequence of nodes where each node holds a value and a pointer to the next node. Learn: Singly linked lists: traverse, insert, delete
load factor
The number of stored keys divided by the number of buckets. When it grows too high, a hash table resizes. Learn: Load factor and resizing
logarithm
The power you must raise a base to in order to get a number. log₂ n counts how many times n can be halved before reaching 1.
logarithmic time
Running time that grows by one step each time the input doubles, written O(log n).
longest common subsequence
The longest sequence that appears, in order, as a subsequence of both of two strings. Learn: String DP: LCS, edit distance, palindromic subsequence
longest increasing subsequence
The longest subsequence of an array whose values strictly increase. Learn: Longest increasing subsequence; the n log n version
lower bound
The least amount of work any algorithm must do for a problem. Also the first position where a value could be inserted in sorted order.
lowest common ancestor
The deepest node in a rooted tree that is an ancestor of both of two given nodes.
LRU
Least recently used: an eviction policy that removes the item that has gone unused for the longest time. Learn: LRU and LFU caches
memoization
Storing the result of each function call so a repeated call with the same arguments returns the saved answer. Learn: Overlapping subproblems and memoization
merge
Combining two sorted sequences into one sorted sequence by repeatedly taking the smaller front item. Learn: Merge sort
min-heap
A heap in which every parent is less than or equal to its children, so the smallest item is at the root. Learn: Binary heaps: array layout, sift up, sift down
modulo
The remainder after division. Arithmetic modulo m wraps around to 0 after reaching m − 1, like a clock.
monotonic stack
A stack whose items stay in increasing or decreasing order because smaller or larger items are popped before each push.
MST
A minimum spanning tree: a set of edges that connects every vertex with the smallest possible total weight and no cycles. Learn: Kruskal's algorithm
mutex
A lock that only one thread can hold at a time, used to protect a critical section.
n log n
Running time proportional to n × log n, the cost of efficient comparison sorts such as merge sort.
node
One element of a linked structure such as a list, tree or graph, holding a value and links to other nodes. Learn: Trees: root, leaf, depth, height, subtree
NP-complete
A problem in NP that every NP problem reduces to. No fast algorithm is known for any of them.
open addressing
A hash table design that stores every key in the bucket array itself and probes other slots when a collision happens. Learn: Open addressing: linear, quadratic probing, double hashing
overfitting
When a model learns the noise in its training data and so performs worse on new data.
overflow
When a result is too large for its storage: an integer wraps around, or a call stack runs out of room.
page fault
When a program touches a page that is not in physical memory, so the operating system must load it first.
palindrome
A sequence that reads the same forwards and backwards, such as "racecar".
parent
The node directly above another node in a tree. Every node except the root has exactly one parent. Learn: Trees: root, leaf, depth, height, subtree
partition
Rearranging an array around a pivot so smaller items come before it and larger items after it. Learn: Quick sort: partitioning and pivots
path
A sequence of vertices in which each consecutive pair is joined by an edge. Learn: Graphs: vertices, edges, directed, weighted, degree, paths
pivot
The element quick sort or quickselect uses to split an array into smaller and larger parts. Learn: Quick sort: partitioning and pivots
pointer
A value that holds the memory address of another value, or more loosely, any index that marks a position.
post-order
A tree traversal that visits both subtrees before the node itself. Learn: Pre-order, in-order, post-order
pre-order
A tree traversal that visits the node first, then its left subtree, then its right subtree. Learn: Pre-order, in-order, post-order
prefix sum
An array where entry i holds the sum of the first i input values, so any range sum is one subtraction.
Prim
A minimum spanning tree algorithm that grows one tree from a start vertex by always adding the cheapest edge leaving it. Learn: Prim's algorithm
priority queue
A collection that always removes the item with the highest priority next. It is usually built on a heap. Learn: Priority queues in practice: top-k, k-way merge, scheduling
probing
Checking a sequence of other buckets after a collision in open addressing until a free or matching slot is found. Learn: Open addressing: linear, quadratic probing, double hashing
pseudocode
A plain, language-neutral way to write an algorithm’s steps, meant for people rather than computers.
quadratic time
Running time proportional to the square of the input size, written O(n²), typical of nested loops over the input.
queue
A collection that adds items at the back and removes them from the front: first in, first out. Learn: Queues: enqueue, dequeue; circular buffer
race condition
A bug where the result depends on the timing of threads that access shared data without coordination.
recurrence
An equation that defines a value, such as a running time, in terms of smaller values, like T(n) = 2T(n/2) + n.
recursion
A function solving a problem by calling itself on smaller versions of the same problem until it reaches a base case. Learn: Recursion: base case, recursive case, the call stack
red-black tree
A self-balancing binary search tree that colours nodes red or black and follows rules that keep its height O(log n). Learn: Red-black trees
reference
A value that points to an object stored elsewhere. Two references can point to the same object.
relaxation
Checking whether a path through an edge improves a vertex’s best known distance and updating it if so. Learn: Dijkstra's algorithm
residual graph
In max flow, the graph of remaining capacity on each edge plus reverse edges that allow flow to be undone. Learn: Maximum flow: Ford-Fulkerson and Edmonds-Karp
rotation
A local restructuring of a binary search tree that changes its shape but keeps the in-order sequence the same. Learn: AVL trees and rotations
salt
Random data added to a password before hashing, so equal passwords produce different stored hashes.
segment tree
A binary tree over an array where each node stores a summary of a range, giving O(log n) range queries and updates.
semaphore
A counter that threads decrement to take a resource and increment to release it, blocking when it reaches zero.
sentinel
A placeholder element at the edge of a structure that removes special cases, such as a dummy head node in a list.
shortest path
A path between two vertices with the fewest edges, or the smallest total weight in a weighted graph. Learn: Shortest paths in unweighted graphs; path reconstruction
sliding window
A contiguous range that moves across an array or string, updating its result as elements enter and leave.
space complexity
How the extra memory an algorithm needs grows with the input size.
stable sort
A sort that keeps items with equal keys in their original relative order.
stack
A collection that adds and removes items at the top only: last in, first out. Learn: Stacks: push, pop, peek; array and linked implementations
strongly connected
A set of vertices in a directed graph in which every vertex can reach every other. Learn: Strongly connected components: Kosaraju and Tarjan
subarray
A contiguous, non-empty part of an array.
subsequence
Elements taken from a sequence in their original order, not necessarily next to each other. Learn: Longest increasing subsequence; the n log n version
substring
A contiguous run of characters inside a string.
tabulation
Dynamic programming that fills a table from the smallest subproblems upward, without recursion. Learn: Tabulation: filling the table bottom-up
tail recursion
Recursion where the recursive call is the very last action, so the current frame is no longer needed.
time complexity
How the number of steps an algorithm takes grows with the input size.
topological order
An ordering of a DAG’s vertices in which every edge points from an earlier vertex to a later one. Learn: Topological sort: Kahn's algorithm and DFS finishing order
travelling salesperson problem
Find the shortest route that visits every city exactly once and returns home. It is NP-hard; bitmask DP solves small cases. Learn: Bitmask DP: TSP and assignments
traversal
Visiting every element of a structure once in some systematic order. Learn: Pre-order, in-order, post-order
tree
A connected structure with no cycles, usually drawn with a root at the top and children below. Learn: Trees: root, leaf, depth, height, subtree
trie
A tree that stores strings character by character, so words with a common prefix share a path. Learn: Tries: insert, search, prefix
two pointers
A technique that moves two indices through a sequence, often from both ends inward, to avoid checking every pair.
two's complement
The usual way to store signed integers: a negative number is formed by inverting the bits of its magnitude and adding one.
union-find
A structure that tracks which items belong to the same group, supporting near-constant-time find and union. Learn: Disjoint set union: find, union, rank, path compression
UTF-8
A variable-length encoding that stores each Unicode code point in one to four bytes and matches ASCII for the first 128.
vertex
A point in a graph that edges connect. Learn: Graphs: vertices, edges, directed, weighted, degree, paths
virtual memory
Giving each process its own address space whose pages the operating system maps onto physical memory frames.
weighted graph
A graph in which every edge carries a number, such as a distance or cost. Learn: Graphs: vertices, edges, directed, weighted, degree, paths
worst case
The input of a given size that makes an algorithm do the most work.