Created
December 13, 2021 15:00
-
-
Save atoye1/de6d6fac36db5aab9d92d75bcc09a93b to your computer and use it in GitHub Desktop.
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
void addNode(linkedList_h*, int x){ | |
listNode* NewNode; | |
listNode* LastNode; | |
NewNode = (linkedList_h*)malloc(sizeof(linkedList_h)); | |
NewNode->data = x; | |
NewNode->link = NULL; | |
if (H->head == NULL){ | |
H->head = NewNode; | |
NewNode->link = NULL; | |
return; | |
} | |
LastNode = H->head; | |
while(LastNode->link != NULL){ | |
LastNode = LastNode->link; | |
} | |
lastNode->link = NewNode; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment