You are viewing a single comment's thread. Return to all comments →
Here is another clean and tidy solution in java. If you have any question, feel free to ask.
int GetNode(Node head,int n) { Node temp = head; for (int i = 0; head.next != null; i++) { head = head.next; if ( i >= n) temp = temp.next; } return temp.data; }
Seems like cookies are disabled on this browser, please enable them to open this website
Get Node Value
You are viewing a single comment's thread. Return to all comments →
Here is another clean and tidy solution in java. If you have any question, feel free to ask.