You are viewing a single comment's thread. Return to all comments →
commplete this method Node *prev = NULL; Node *ptr = head;
int pos = 0; if(position==0) { head=head->next; delete (ptr); } else { while(position!=pos) { ++pos; prev=ptr; ptr=ptr->next; } if(ptr!=NULL) { prev->next=ptr->next; delete (ptr); } } 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 →
commplete this method Node *prev = NULL; Node *ptr = head;
}