You are viewing a single comment's thread. Return to all comments →
Java recursive solution:
Node RemoveDuplicates(Node head) { if(head== null) return head; if(head.next == null) return head; if(head.data == head.next.data) { head = RemoveDuplicates(head.next); return head; } else head.next = RemoveDuplicates(head.next); return head; }
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 →
Java recursive solution: