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
- An interesting method to print reverse of a linked list
- Print Doubly Linked list in Reverse Order
- Print reverse of a Linked List without extra space and modifications
- Print the last k nodes of the linked list in reverse order | Iterative Approaches
- Print the last k nodes of the linked list in reverse order | Recursive approach
- Recursively Reversing a linked list (A simple implementation)
- Can we reverse a linked list in less than O(n)?
- Reverse a linked list
- Reverse even elements in a Linked List
- Reverse a sublist of linked list
- Reverse a circular linked list
- Reverse a Doubly Linked List | Set-2
- Reverse first K elements of given linked list
- Reverse a Linked List according to its Size