You are viewing a single comment's thread. Return to all comments →
my Java Sol :
Node RemoveDuplicates(Node head) { Node h=head,pre=head; while(head.next!=null){ if(pre.data!=head.data){pre=head;} head=head.next; if(pre.data==head.data){pre.next=head.next;} } return h; }
Seems like cookies are disabled on this browser, please enable them to open this website
Delete duplicate-value nodes from a sorted linked list
You are viewing a single comment's thread. Return to all comments →
my Java Sol :