Tag
#two-pointers
4 articles tagged two-pointers.
Coding Questions to Memorise: The Pattern Templates That Crack the Coding Interview
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.
Linked Lists Explained: Nodes, Pointers, In-Place Reversal, and Floyd's Cycle Detection
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.
Sliding Window: Turning O(n²) Subarray Scans Into One Clean Pass
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.
Two Pointers: Turning an O(n²) Pair Hunt Into a Single O(n) Walk
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.