Linked List pattern
Reverse Linked List
Given the head of a singly linked list, reverse the list and return the new head. Watch it run step by step, then write your own pseudocode and get it checked by AI.
- LeetCode 206
- Easy
- 2 approaches
Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.
Linked ListLeetCode 206
Easy
From the first idea to the best one
- 01 Iterative · three pointers O(n)O(1) space
- 02 Recursive O(n)O(n) space
What you will learn
- How to read Reverse Linked List and spot the linked list pattern in it
- Iterative · three pointers: O(n) time, O(1) space
- Recursive: O(n) time, O(n) space
- The pseudocode for each approach, its line lit as the animation runs
- Practice: write your own pseudocode and get it checked
More Linked List
See Reverse Linked List run, step by step
Sign in and this page opens on the animation, with all 9 Linked List problems beside it.
DSA comes with the all labs plan and every ChaiCode batch.