</>
ShikshaCSLearn. Code. Grow.
🔍
☕ Support Us
ShikshaCSâ€ēPractice Problems
DSAEasyLinked List

Reverse a Linked List

📋 Problem

Given a singly linked list, reverse it so the last node becomes the first.

🧭 Approach

Keep three pointers: previous (starts as NULL), current (starts at head), and next (temporary). For each node, save its next node, then point current's 'next' backward to previous, then move previous and current one step forward. Repeat until current becomes NULL — previous is now the new head.

← Back to all Problems