Search posts, tags, users, and pages
Abstract Algorithms
Exploring the fascinating world of algorithms, data structures, and software engineering through clear explanations and practical examples.
TLDR: Reversing a linked list in O(1) space requires three pointers — prev, curr, and next. Each step: save next, flip curr.next to point backward, advance both prev and curr. Learn this once and you
Markdown supported · ⌘↵ to post
No responses yet.