You are viewing a single comment's thread. Return to all comments →
My solution in C#: easiest solution
static SinglyLinkedListNode removeDuplicates(SinglyLinkedListNode llist) { SinglyLinkedListNode currNode = llist;
while(currNode !=null && currNode.next!= null) { if(currNode.data==currNode.next.data) { currNode.next = currNode.next.next; } else currNode = currNode.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 solution in C#: easiest solution
static SinglyLinkedListNode removeDuplicates(SinglyLinkedListNode llist) { SinglyLinkedListNode currNode = llist;