You are viewing a single comment's thread. Return to all comments →
C solution
Node *temp = (Node*)malloc(sizeof(Node)); temp->data = data; temp->next = NULL; if(NULL == head){ head = temp; } else{ Node *ptr = head; while(ptr->next){ ptr = ptr->next; } ptr->next = temp; } return head;
Day 15: Linked List
You are viewing a single comment's thread. Return to all comments →
C solution