Compiling brilliance
Did you know? An LRU cache is a HashMap + a doubly-linked list → O(1) get & put.
Compiling brilliance
Did you know? An LRU cache is a HashMap + a doubly-linked list → O(1) get & put.
Tag
10 articles tagged data-structures.
A diagram-first guide to the array and dynamic array data structure: O(1) random access, why append is amortized O(1) via doubling, time complexity, and interview questions.
Balanced search trees explained: AVL and red-black, the self-balancing binary search tree data structure that guarantees O(log n). Rotations, time complexity, and interview questions.
A diagram-first guide to the binary search tree data structure and its algorithms: search, insert, in-order sort, and the three delete cases, with time complexity and interview questions.
A diagram-first guide to the binary tree data structure: nodes, terminology, the three DFS traversals plus level-order BFS, height and time complexity, and a complete interview-ready implementation.
A diagram-first guide to the graph data structure: vertices and edges, adjacency list vs matrix, degree, connected components, time complexity, and a complete implementation for interviews.
A diagram-first guide to the hash table data structure: hashing, buckets, collisions, chaining, load factor, resize, equals/hashCode contract, time complexity, and hash map interview questions.
A diagram-first guide to the linked list data structure: singly vs doubly linked nodes, O(1) splicing, in-place reversal, Floyd cycle detection, plus time complexity and interview prep.
A diagram-first guide to the queue and deque data structure: FIFO enqueue and dequeue, the circular buffer (ring) fix, sliding window maximum, time complexity, and interview questions.
The stack data structure (LIFO) explained: push, pop, peek in O(1), the call stack behind recursion, and the monotonic stack, with time complexity and a full implementation for your coding interview.
A diagram-first guide to the union-find (disjoint set union) data structure: find and union, path compression, union by rank, near-constant time complexity, and interview code.