Given a linked list, print reverse of it using a recursive function. For example, if the given linked list is 1->2->3->4, then output should be 4->3->2->1.
Note that the question is only about printing the reverse. To reverse the list itself see this
Difficulty Level: Rookie
printReverse(head) 1. call print reverse for hed->next 2. print head->data
4 3 2 1
Time Complexity: O(n)
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Print Reverse a linked list using Stack
- Print Doubly Linked list in Reverse Order
- An interesting method to print reverse of a linked list
- Print reverse of a Linked List without extra space and modifications
- Recursively Reversing a linked list (A simple implementation)
- Reverse a linked list
- Can we reverse a linked list in less than O(n)?
- Reverse a Linked List according to its Size
- Reverse a Doubly Linked List | Set-2
- Reverse first K elements of given linked list
- Reverse a circular linked list
- Reverse a Doubly Linked List
- Reverse a sublist of linked list
- Java Program for Reverse a linked list
- Reverse a doubly circular linked list
Improved By : Aashish Kumar 7