geeksforgeeks
  • Courses
  • Tutorials
  • Practice
  • Jobs
  • DSA
  • Practice Problems
  • C
  • C++
  • Java
  • Python
  • JavaScript
  • Data Science
  • Machine Learning
  • Courses
  • Linux
  • DevOps
Videos
July 31, 2024 |13.3K Views

Reversing a linked list

Linked List, linked-list, reverse-program
 Save  Share   Like
Description
Discussion

Given pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list by changing the links between nodes.

Examples:

Input: Head of following linked list 
1->2->3->4->NULL 
Output: Linked list should be changed to, 
4->3->2->1->NULL

 

Reversing a linked list : https://www.geeksforgeeks.org/reverse-a-linked-list/

Recommendations
Video Thumbnail
10:09
Video Thumbnail
44.1K Views | 10/01/2025...
Pairwise swap elements of a given linked list
Video Thumbnail
08:48
Video Thumbnail
5.7K Views | 10/01/2025...
Identical Linked Lists
Video Thumbnail
16:14
Video Thumbnail
92.2K Views | 10/01/2025...
Merge two sorted linked lists
Video Thumbnail
06:44
Video Thumbnail
28.5K Views | 10/01/2025...
Remove duplicates from a sorted linked list
Video Thumbnail
02:37
Video Thumbnail
73.4K Views | 04/01/2025...
Circular Linked List | Set 1 (Introduction and Applications)
Video Thumbnail
07:00
Video Thumbnail
36.4K Views | 31/07/2024...
Detect and Remove Loop in a Linked List (Explained in Hindi)
Video Thumbnail
07:00
Video Thumbnail
71.6K Views | 18/07/2024...
Detection of Loop in a Linked List (Explained In Hindi)
Video Thumbnail
11:07
Video Thumbnail
3.5K Views | 15/07/2024...
Sorted insert for circular linked list
Video Thumbnail
06:03
Video Thumbnail
13.1K Views | 15/07/2024...
Find the length of loop in linked list
Video Thumbnail
08:50
Video Thumbnail
11.0K Views | 15/07/2024...
Delete middle of linked list
GeeksforGeeks
location
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
location
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play StoreGFG App on App Store
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • Careers
  • Contact Us
  • Corporate Solution
  • Campus Training Program
  • Explore
  • POTD
  • Practice Problems
  • Connect
  • Blogs
  • Upskill Courses
  • Tutorials
  • Programming Languages
  • DSA
  • Web Technology
  • AI, ML & Data Science
  • DevOps
  • CS Core Subjects
  • GATE
  • School Subjects
  • Software and Tools
  • Courses
  • ML and Data Science
  • DSA and Placements
  • Web Development
  • Data Science
  • Programming Languages
  • DevOps & Cloud
  • GATE
  • MongoDB Certifications
  • Offline Centers
  • Noida
  • Bengaluru
  • Hyderabad
  • Kolkata
  • Preparation Corner
  • Interview Corner
  • Aptitude
  • Puzzles
  • GfG 160
  • System Design
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved