You are viewing a single comment's thread. Return to all comments →
My Java 8 Solution
public static SinglyLinkedListNode removeDuplicates(SinglyLinkedListNode llist) { SinglyLinkedListNode current = llist; while (current != null && current.next != null) { if (current.data == current.next.data) { current.next = current.next.next; } else { current = current.next; } } return llist; }
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 8 Solution