-
-
Save chintanparikh/4165137 to your computer and use it in GitHub Desktop.
removeNode
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
| void removeNode(struct node** headRef, struct node* del) | |
| { | |
| if (del == NULL || *headRef == NULL) | |
| { | |
| return; | |
| } | |
| if (*headRef == del) | |
| { | |
| *headRef = del->next; | |
| } | |
| if (del->next != NULL) | |
| { | |
| del->next->previous = del->previous; | |
| } | |
| if (del->previous != NULL) | |
| { | |
| del->previous->next = del->next; | |
| } | |
| free(del); | |
| return; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment