You are viewing a single comment's thread. Return to all comments →
The C code 😎😁
int getNode(SinglyLinkedListNode* llist, int positionFromTail) { SinglyLinkedListNode* current=llist; int len=0,node=0; while(current!=NULL) { len++; current=current->next; } current=llist; for(int i=0;i<len;i++) { if(i==len-positionFromTail-1) { node=current->data; } current=current->next; } return node; }
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 →
The C code 😎😁