You are viewing a single comment's thread. Return to all comments →
For Beginners
Node* insert(Node *head,int data) {
struct Node* new_node = (struct Node*) malloc(sizeof(struct Node)); Node *ptr = head ; new_node->data = data; new_node->next = NULL; if(head==NULL){ return new_node; } while(ptr->next!=NULL){ ptr = ptr->next; } ptr->next = new_node; return head;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 15: Linked List
You are viewing a single comment's thread. Return to all comments →
C Approach
For Beginners
Node* insert(Node *head,int data) {
}