You are viewing a single comment's thread. Return to all comments →
here is simple Java Solution
Node Delete(Node head, int position) {
int count=0; if(position==0){ return head.next; } if(head==null){ return head; } Node current=head; while(current.next!=null){ if(count==position-1){ Node temp=current.next.next; current.next=temp; break; } current=current.next; count++; } 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 →
here is simple Java Solution
Node Delete(Node head, int position) {