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.
Improved By : Aashish Kumar 7
- Remove duplicates from a sorted linked list
- Reverse a linked list
- Remove duplicates from an unsorted linked list
- Write a function to get the intersection point of two Linked Lists.
- Function to check if a singly linked list is palindrome
- Count pairs in a binary tree whose sum is equal to a given value x
- Mu Sigma Interview On Campus
- Bank Of America (BA Continuum India Pvt. Ltd.) Campus Recruitment
- Bubble Sort On Doubly Linked List
- Reverse nodes of a linked list without affecting the special characters