You are viewing a single comment's thread. Return to all comments →
shorter
int GetNode(Node *head,int positionFromTail) { Node *p = head; while(head) { if(positionFromTail < 0) p = p->next; positionFromTail--; head = head->next; } return p->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 →
shorter