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