You are viewing a single comment's thread. Return to all comments →
int getNode( SinglyLinkedListNode * head , int positionFromTail) {
SinglyLinkedListNode * cur = head; SinglyLinkedListNode *prev =head; while(positionFromTail){ cur=cur->next; positionFromTail--; } while(cur!=NULL){ prev=prev->next; cur=cur->next; } return prev->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 →
int getNode( SinglyLinkedListNode * head , int positionFromTail) {
}