You are viewing a single comment's thread. Return to all comments →
Why is this code showing error in test case 2?
SinglyLinkedListNode *prev,*t; prev = NULL; t = head; if( position == 0 ){ head = head->next; delete(head); } while( position > 0 ){ prev = t; t = t->next; position--; } if(t != NULL){ prev->next = t->next; delete(t); } return head;
Seems like cookies are disabled on this browser, please enable them to open this website
Delete a Node
You are viewing a single comment's thread. Return to all comments →
Why is this code showing error in test case 2?