DSA Glossary Resource - aloalgo

DSA Glossary

A quick-reference glossary of key terms you'll encounter throughout this course and in coding interviews.

Table of Contents

A · B · C · D · E · G · H · I · K · L · M · N · O · P · Q · R · S · T · V

A

Adjacency List
A way to represent a graph where each node stores a list of its neighbors. Space-efficient for sparse graphs.
Adjacency Matrix
A 2D matrix representation of a graph where matrix[i][j] indicates an edge between nodes i and j. Allows O(1) edge lookup but uses O(V²) space.
Algorithm
A step-by-step set of instructions for solving a problem or accomplishing a task. See What is an Algorithm?
Amortized Analysis
A method of analyzing the average time per operation over a worst-case sequence of operations. For example, dynamic array appends are O(1) amortized despite occasional O(n) resizing.
Array
A contiguous block of memory storing elements of the same type, accessible by index in O(1) time. See Arrays.

B

Backtracking
A recursive technique that explores all possible solutions by building candidates incrementally and abandoning ("pruning") paths that cannot lead to a valid solution. See Introduction to Backtracking.
Base Case
The condition in a recursive function that stops the recursion. Without a base case, the function would recurse infinitely.
BFS (Breadth-First Search)
A graph/tree traversal algorithm that explores all neighbors at the current depth before moving to the next level. Uses a queue. See Graph Traversal.
Big O Notation
A mathematical notation describing the upper bound of an algorithm's time or space complexity as input size grows. Common complexities: O(1), O(log n), O(n), O(n log n), O(n²), O(2ⁿ).
Binary Search
An efficient algorithm for finding an element in a sorted array by repeatedly dividing the search interval in half. Runs in O(log n) time. See Binary Search.
Binary Search Tree (BST)
A binary tree where each node's left subtree contains only smaller values and the right subtree contains only larger values. See Binary Search Trees.
Binary Tree
A tree data structure where each node has at most two children, referred to as left and right. See Tree Fundamentals.
Bit Manipulation
Using bitwise operators (AND, OR, XOR, NOT, shifts) to perform operations directly on binary representations of numbers. See Introduction to Bit Manipulation.
Brute Force
An approach that tries all possible solutions to find the correct one. Often the simplest but least efficient method.
Bubble Sort
A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. O(n²) time. See Bubble, Insertion and Selection Sort.

C

Collision (Hash)
When two different keys hash to the same index in a hash table. Resolved through techniques like chaining or open addressing.
Connected Component
A maximal set of nodes in an undirected graph such that there is a path between every pair of nodes in the set.
Counting Sort
A non-comparison sorting algorithm that counts occurrences of each value. Runs in O(n + k) time where k is the range of input values. See Radix and Counting Sort.
Cycle
A path in a graph or linked list that starts and ends at the same node. Cycle detection is a common interview problem.

D

DAG (Directed Acyclic Graph)
A directed graph with no cycles. Often used with topological sort for dependency ordering.
Data Structure
A way of organizing and storing data to enable efficient access and modification. See What is a Data Structure?
DFS (Depth-First Search)
A graph/tree traversal algorithm that explores as far as possible along each branch before backtracking. Uses a stack (or recursion). See Graph Traversal.
Dijkstra's Algorithm
A shortest-path algorithm for graphs with non-negative edge weights. Uses a priority queue and runs in O((V + E) log V) time. See Dijkstra.
Dynamic Programming (DP)
An optimization technique that solves complex problems by breaking them into overlapping subproblems and storing their solutions to avoid redundant computation. See Recursion to Memoization.

E

Edge
A connection between two nodes in a graph. Can be directed (one-way) or undirected (two-way), and may carry a weight.
Edge Case
An unusual or extreme input that may cause an algorithm to behave unexpectedly. Examples: empty input, single element, duplicates, negative numbers.

G

GCD (Greatest Common Divisor)
The largest number that divides two integers without a remainder. Often computed using the Euclidean algorithm. See GCD & LCM.
Graph
A data structure consisting of nodes (vertices) and edges connecting them. Can be directed or undirected, weighted or unweighted. See Graph Fundamentals.
Greedy Algorithm
An approach that makes the locally optimal choice at each step, hoping to find the global optimum. See Greedy Algorithms.

H

Hash Function
A function that maps data of arbitrary size to fixed-size values. Used in hash maps and hash sets to compute the index for storing data.
Hash Map (Dictionary)
A data structure that stores key-value pairs with average O(1) lookup, insertion, and deletion. See Hash Maps.
Hash Set
A collection of unique elements with average O(1) lookup, insertion, and deletion. See Hash Sets.
Heap
A complete binary tree where each parent is smaller (min-heap) or larger (max-heap) than its children. Supports O(log n) insert and extract. See Introduction to Heaps.

I

In-order Traversal
A tree traversal that visits the left subtree, then the root, then the right subtree. For a BST, this visits nodes in sorted order. See Tree Traversals.
In-place Algorithm
An algorithm that transforms data using only a constant amount of extra memory (O(1) space), modifying the input directly.
Insertion Sort
A sorting algorithm that builds the sorted array one element at a time by inserting each element into its correct position. O(n²) worst case, O(n) best case. See Bubble, Insertion and Selection Sort.

K

K-way Merge
A technique for merging K sorted lists using a min-heap. Commonly used in problems like "merge K sorted lists."

L

LCM (Least Common Multiple)
The smallest positive integer divisible by both of two given integers. See GCD & LCM.
Leaf Node
A node in a tree with no children.
Linked List
A linear data structure where each element (node) contains data and a pointer to the next node. See Introduction to Linked Lists.

M

Memoization
An optimization technique that caches the results of expensive function calls and returns the cached result when the same inputs occur again. See Recursion to Memoization.
Merge Sort
A divide-and-conquer sorting algorithm that divides the array in half, recursively sorts each half, then merges them. O(n log n) time, O(n) space. See Merge, Quick, and Heap Sort.
Modular Arithmetic
Arithmetic where numbers wrap around after reaching a certain value (the modulus). Important for handling large numbers in competitive programming. See Modular Arithmetic.
Monotonic Stack
A stack that maintains elements in increasing or decreasing order. Used for "next greater element" style problems. See Stack Applications and Patterns.

N

Node
A fundamental unit in data structures like trees, graphs, and linked lists. Contains data and references to other nodes.

O

Optimal Substructure
A property where the optimal solution to a problem can be constructed from optimal solutions to its subproblems. A key requirement for dynamic programming.
Overlapping Subproblems
When a recursive algorithm solves the same subproblems multiple times. Dynamic programming exploits this by storing results.

P

Pointer
A reference to a node or memory location. Used extensively in linked lists, trees, and the two-pointer technique.
Prefix Sum (Prefix Array)
An array where each element stores the cumulative sum of all elements up to that index. Enables O(1) range sum queries. See Prefix & Suffix Arrays.
Priority Queue
An abstract data type where each element has a priority, and elements are served in order of priority. Typically implemented with a heap. See Introduction to Heaps.
Pruning
Eliminating branches of a search tree that cannot lead to a valid solution. A key optimization in backtracking algorithms.

Q

Queue
A First-In-First-Out (FIFO) data structure. Elements are added at the back and removed from the front. See Introduction to Stacks and Queues.
Quick Sort
A divide-and-conquer sorting algorithm that selects a pivot and partitions elements around it. O(n log n) average, O(n²) worst case. See Merge, Quick, and Heap Sort.

R

Recursion
A technique where a function calls itself to solve smaller instances of the same problem. See Recursion Basics.
Root
The topmost node of a tree. It has no parent and serves as the entry point for tree operations.

S

Sliding Window
A technique that maintains a window (subarray/substring) that slides across the input to efficiently process contiguous elements. See Sliding Window.
Space Complexity
A measure of how much extra memory an algorithm uses relative to the input size. Expressed using Big O notation.
Stable Sort
A sorting algorithm that preserves the relative order of elements with equal keys. Merge sort and insertion sort are stable; quick sort is not.
Stack
A Last-In-First-Out (LIFO) data structure. Elements are added and removed from the top. See Introduction to Stacks and Queues.
Subproblem
A smaller instance of the original problem. Solving subproblems is the basis of recursion and dynamic programming.

T

Tabulation
A bottom-up dynamic programming approach that fills in a table iteratively, starting from the smallest subproblems. See 1D Dynamic Programming.
Time Complexity
A measure of how the running time of an algorithm grows relative to the input size. Expressed using Big O notation.
Topological Sort
A linear ordering of nodes in a DAG such that for every directed edge (u, v), node u comes before v. See Topological Sort.
Tree
A hierarchical data structure consisting of nodes connected by edges, with a single root node and no cycles. See Tree Fundamentals.
Trie (Prefix Tree)
A tree-like data structure used for efficient retrieval of strings. Each node represents a character, and paths from root to nodes form prefixes. See Introduction to Trie.
Two Pointers
A technique using two references to traverse data structures, often from opposite ends or at different speeds. See Two Pointers Basics.

V

Vertex
A node in a graph. The terms "vertex" and "node" are used interchangeably in graph theory.
Visited Set
A set used during graph/tree traversal to track which nodes have already been explored, preventing infinite loops in cyclic graphs.
Was this helpful?
© 2026 aloalgo. All rights reserved.