You are viewing a single comment's thread. Return to all comments →
public static Node removeDuplicates(Node head) { //Write your code here Node start = head; while(head != null && head.next != null) { if (head.data == head.next.data) { head.next = head.next.next; } else { head = head.next; } } return start; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 24: More Linked Lists
You are viewing a single comment's thread. Return to all comments →