You are viewing a single comment's thread. Return to all comments →
i have done without recurrsion:
void ReversePrint(Node head) {
Node node=head; Node node1=head; int c=0; while(node!=null) { c++; node=node.next; } //System.out.println(c); int arr[]=new int[c]; int i=0; while(node1!=null) { arr[i]=node1.data; i++; node1=node1.next; } int j; if(c>0) { for(j=(c-1);j>=0;j--) { System.out.println(arr[j]); } }
}
Print in Reverse
You are viewing a single comment's thread. Return to all comments →
i have done without recurrsion:
void ReversePrint(Node head) {
}