Created
November 5, 2015 11:31
-
-
Save irrationnelle/92637b40db788152baaf to your computer and use it in GitHub Desktop.
I used 'for loop' for finding certain Node, but my condition must be added 'Tail != NULL' in if statement. But I don't understand why I should use this condition.
This file contains 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* SLL_GetNodeAt(Node* Head, int location) | |
{ | |
int i; | |
Node* Tail = *Head; | |
for(i=0; i<location; i++) | |
{ | |
Tail=Tail->NextNode; | |
} | |
return Tail; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment