Dynamic Array in C: Building a Growable Vector with realloc
How a dynamic array grows in C: the size and capacity pair, what the growth factor costs in copies and waste, and the realloc mistakes ASan catches.
How a dynamic array grows in C: the size and capacity pair, what the growth factor costs in copies and waste, and the realloc mistakes ASan catches.
How a sentinel node removes the boundary cases, why the second pointer makes removal O(1), and what circular lists buy in rotation and reverse walks.
How adjacency matrices and adjacency lists compare in memory, how BFS and DFS walk a graph, and why recursive DFS overflows the stack on long paths.
How a binary heap backs a priority queue, why the standard libraries disagree about the top, and what the heap buys over a sorted array in practice.
How ordered operations, rank and select work on a binary search tree, why sorted input turns it into a list, and what the three delete cases cost.
What each type of data structure stores, how fast its operations run, which one to choose, and what C, C++, Java, Python and C# provide.
How chaining and open addressing behave at four load factors, why deletion needs tombstones, and what a weak hash costs on 50,000 real-looking keys.
Three queue layouts in five languages: what each costs in memory and time, and why a circular queue needs a count, a spare slot or a flag.
Enums in C explained with tested code: an order-status example, enum to string, bit flags, X-macros, C23 enum types, and how C++ enum class differs.
The best algorithms and data structures books by goal (theory, practice, language-specific, interview prep), with editions and where to start.
A route planner in C that finds shortest paths with Dijkstra and Floyd–Warshall, handles unreachable towns and negative weights, and measures both.
At n = 1,000,000, O(log n) takes 20 steps and O(n squared) takes a trillion. The ten families that matter, with complexity for each.