You are viewing a single comment's thread. Return to all comments →
Well here's my take to it!
Node* Delete(Node *head, int position) { struct Node *i,*j,*newn; int count=0; if(position==0 &&head->next!=NULL){ j=head; head=head->next; //free(j); } else{ i=head; j=i; while(i->next!=NULL&&count<position){ j=i; i=i->next; count++; } j->next=i->next; free(i); } 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 →
Well here's my take to it!