Monday, January 25, 2016

Print linked List Value from end in java





public void printListFromEnd(ListNode head){

if(head == null){
return;
}
printListFromEnd(head.getNext());
System.out.println(head.getData());
}

No comments:

Post a Comment