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
4 articles tagged arrays.
A diagram-first guide to the binary search algorithm: the lo/hi/mid loop, avoiding overflow, lower and upper bound, binary search on the answer, O(log n) time complexity, and interview prep.
The sliding window algorithm explained: fixed and variable windows, the two-pointer technique, amortized O(n) time complexity, and interview code for max subarray sum and longest substring.
A diagram-first guide to sorting algorithms: insertion sort, merge sort, quicksort partition and pivot, heap sort, stability, the O(n log n) lower bound, time complexity, and interview prep.
The two pointers algorithm explained: converging and fast/slow pointers, two-sum on a sorted array, valid palindrome, container with most water, O(n) time complexity, and interview prep.