Created
February 5, 2019 13:00
-
-
Save EvanGertis/60719816bc8300177021a2188083981e 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
struct node | |
{ | |
int data; | |
struct node *link; | |
}; | |
// inserts a node after the header node. | |
void insertAtEnd(struct node *head, int data) | |
{ | |
struct node *p; | |
struct node *temp; | |
temp = (struct node *)malloc(sizeof(struct node)); | |
temp->info = data; | |
p = head; | |
while (p->link != NULL) | |
{ | |
p = p->link; | |
} | |
temp->link = p->link; | |
p->link = temp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment