You are viewing a single comment's thread. Return to all comments →
SinglyLinkedListNode* insertNodeAtTail(SinglyLinkedListNode* head, int data) {
SinglyLinkedListNode *new_node,*ptr; new_node = new SinglyLinkedListNode(); new_node->data = data; new_node->next = NULL; if(head == NULL){ head = new_node; return head; }else{ ptr = head; while(ptr != NULL){ ptr = ptr->next; } ptr->next = new_node; new_node->next = NULL; return head; }
}
can you please help me with this code?
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 →
SinglyLinkedListNode* insertNodeAtTail(SinglyLinkedListNode* head, int data) {
}
can you please help me with this code?