You are viewing a single comment's thread. Return to all comments →
Can you please check what is the problem with this?
SinglyLinkedListNode* insertNodeAtTail(SinglyLinkedListNode* head, int data) {
SinglyLinkedListNode *temp ; temp->data = data; temp->next = NULL; if(head == NULL){ head = temp; } SinglyLinkedListNode *p = head; while(p->next != NULL){ p= p->next; } p->next = temp; return head;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Insert a Node at the Tail of a Linked List
You are viewing a single comment's thread. Return to all comments →
Can you please check what is the problem with this?
SinglyLinkedListNode* insertNodeAtTail(SinglyLinkedListNode* head, int data) {
}