Function to remove duplicates
void removeDuplicates ( Node * head ) { unordered_map < int , bool > track ; Node * temp = head ; while ( temp ) { if ( track . find ( temp -> data ) == track . end ( ) ) { cout << temp -> data << " ▁ " ; } track [ temp -> data ] = true ; temp = temp -> next ; } }