append to list in c

Solutions on MaxInterview for append to list in c by the best coders in the world

showing results for - "append to list in c"
Paula
27 Jul 2017
1void Append(Node *head, Node node){
2	Node tmp = *head;
3    if(*head == NULL) {
4    	*head = node;
5      	return;
6    }
7  	while(tmp->next != NULL){
8    	tmp = tmp->next;
9  	}
10  	tmp->next = node;
11  	return;
12}