Created
March 7, 2012 23:00
-
-
Save fivetanley/1996971 to your computer and use it in GitHub Desktop.
Recursive function to find last node before end of LinkedList
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Node* LinkedList::getBeforeTail(Node* h) | |
{ | |
if (!h.next) | |
{ | |
return 0; | |
} | |
if (getBeforeTail(h) == 0) | |
{ | |
return h; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment