You are viewing a single comment's thread. Return to all comments →
Java 15:
public static int getNode(SinglyLinkedListNode llist, int positionFromTail) { SinglyLinkedListNode iterator = llist; SinglyLinkedListNode result = llist; while(iterator.next != null && positionFromTail > 0) { positionFromTail--; iterator = iterator.next; } while(iterator.next != null) { iterator = iterator.next; result = result.next; } return result.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 →
Java 15: