You are viewing a single comment's thread. Return to all comments →
Java solution using Stack
void ReversePrint(Node head) { Node temp = head; Stack s = new Stack(); while(temp != null){ s.push(temp.data); temp = temp.next; } while(!s.empty()){ System.out.println(s.pop()); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Print in Reverse
You are viewing a single comment's thread. Return to all comments →
Java solution using Stack