Data_structures terms
The right container makes every algorithm faster
Choosing the right data structure is often the difference between an algorithm that runs in milliseconds and one that times out. This category covers arrays, linked lists, trees, graphs, heaps, hash tables, and more complex structures — with focus on when to use each, what operations are fast or slow, and how they underpin the algorithms built on top of them.
Trie (Prefix Tree)
A tree where each node represents a character — paths from root to leaf spell out keys, enabling O(m) lookup, prefix search, and autocomplete where m is key length, independent of dataset size.
1mo ago
data_structures intermediate
Adjacency Matrix vs Adjacency List
Two ways to represent a graph — adjacency matrix (2D array, O(1) edge lookup, O(V²) space) vs adjacency list (array of lists, O(V+E) space, better for sparse graphs).
2mo ago
data_structures intermediate
Circular Buffer / Ring Buffer PHP 5.0+
A fixed-size array treated as circular — the write pointer wraps around when it reaches the end, overwriting the oldest data. Used for logs, audio streaming, and producer-consumer queues.
2mo ago
data_structures intermediate
Graphs
A collection of nodes (vertices) connected by edges — directed or undirected, weighted or unweighted. The most general data structure, modelling networks, dependencies, and relationships.
2mo ago
data_structures intermediate
A hierarchical structure where each node has at most two children — Binary Search Trees enable O(log n) search, while balanced variants (AVL, Red-Black) guarantee it.
2mo ago
data_structures intermediate
A data structure that maps keys to values using a hash function, providing amortised O(1) average-case lookups, insertions, and deletions.
2mo ago
data_structures intermediate
A tree-based structure satisfying the heap property — min-heap: parent ≤ children; max-heap: parent ≥ children — enabling O(1) peek and O(log n) insert/extract for priority queues.
2mo ago
data_structures intermediate