We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Print in Reverse
Print in Reverse
Sort by
recency
|
985 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch the vidéo explanation here : https://youtu.be/WO7Uz7sQML4
here's my solution in C language
void reversePrint(SinglyLinkedListNode* llist) { SinglyLinkedListNode *pre = NULL; SinglyLinkedListNode *next = NULL; SinglyLinkedListNode *current = llist;
}
public static void reversePrint(SinglyLinkedListNode llist) { // Write your code here if (llist == null) return; // Base case for recursion
Kotlin:
This is the perfect way to understand recursive
public static void reversePrint(SinglyLinkedListNode llist) { if(llist != null){ reversePrint(llist.next); System.out.println(llist.data); } }