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 two-pointers.
Coding questions to memorise for interviews: the pattern templates — two pointers, sliding window, binary search, backtracking, DP — that solve most coding interview questions from memory.
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.
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.
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.