You are viewing a single comment's thread. Return to all comments →
recursive go golang solution
func removeDuplicates(llist *SinglyLinkedListNode) *SinglyLinkedListNode { if llist == nil || llist.next == nil { return llist } if llist.data == llist.next.data { llist = removeDuplicates(llist.next) } else { llist.next = removeDuplicates(llist.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 →
recursive go golang solution