Data Structures Glossary
Recursion
Recursion is a programming technique where a function calls itself within its own definition. It is often used to solve problems that can be broken into smaller instances of the same problem.
Array
An array stores items or their references at contiguous memory locations. It allows random access in O(1) time and is cache-friendly. Inefficient for middle insert/delete in unsorted data.
Stack
A stack follows Last In, First Out (LIFO). Think of a stack of plates: last added is first removed.
Queue
A queue follows First In, First Out (FIFO). First element inserted is the first to be removed.
Linked List
A linked list consists of nodes connected by pointers, allowing efficient insertion and deletion.
Tree
A hierarchical non-linear structure of nodes connected by edges, with exactly one path between two nodes.
Binary Search Tree (BST)
A binary tree where left subtree has smaller values, right has larger values.
Binary Heap
A complete binary tree where parent node is smaller (min-heap) or larger (max-heap) than children.
Graph
A set of vertices connected by edges. Can be directed/undirected, weighted/unweighted.