Interview Preparation

Reverse a Linked List

Problem :  You are given a Singly Linked List. You have to write a program to reverse a linked list and then print the reversed linked list. Given a linked list of N nodes. The task is to reverse this list. Example 1: Input: LinkedList: 1->2->3->4->5->6 Output: 6 5 4 3 2 1 Explanation: After

Reverse a Linked List Read More »