We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Great explanation. I rewrite the idea in the following way
intGetNode(Node*head,intpositionFromTail){// walks in the liked listNode*iter=head;for(inti=0;i<=positionFromTail;++i){iter=iter->next;}Node*result=head;while(iter!=NULL){iter=iter->next;result=result->next;}returnresult->data;}
Cookie support is required to access HackerRank
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 →
Great explanation. I rewrite the idea in the following way