You are viewing a single comment's thread. Return to all comments →
Problems seems to be broken with C++.
Node* Delete(Node *head, int position) { if(position == 0){ Node* next = head->next; delete head; return next; } Node* current = head; Node* prev = head; for(int i = 0; i < position; i++){ prev = current; current = current->next; } prev->next = current->next; delete current; return head; }
Output is correct, however it's not breaking lines correctly:
23 13 12 4351
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 →
Problems seems to be broken with C++.
Output is correct, however it's not breaking lines correctly: