• + 1 comment

    Here is my Java solution,

    public static void reversePrint(SinglyLinkedListNode llist) { Stackstack=new Stack<>(); SinglyLinkedListNode current = llist; while(current!=null) { stack.push(current.data); current=current.next; } while (!stack.isEmpty()) { System.out.println(stack.pop()); } } }