Skip to content

Instantly share code, notes, and snippets.

@jitsceait
Created November 29, 2015 13:31
Show Gist options
  • Save jitsceait/aa57eeb422155387bd30 to your computer and use it in GitHub Desktop.
Save jitsceait/aa57eeb422155387bd30 to your computer and use it in GitHub Desktop.
int findNthNode(Node *head, Node **nthNode, int n){
if(!head) return 1;
int count = findNthNode(head->next, nthNode, n);
//If we have unstack n calls from stack
if(count == n){
*nthNode = head;
return ++count;
}
return ++count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment