3. Eliminate dupicates from the array #

Created Saturday 18 January 2020

{ if (trav->next->data = trav->data) { node* to_be_deleted = trav->next; trav->next = trav->next->next; delete to_be_deleted; } // do not move forward as there may be more than 2 duplicates in a row. Move only if we find that the next is different. else trav = trav->next; }