Function to remove duplicates
static void removeDuplicates ( Node head ) { Dictionary < int , bool > track = new Dictionary < int , bool > ( ) ; Node temp = head ; while ( temp != null ) { if ( ! track . ContainsKey ( temp . data ) ) { Console . Write ( temp . data + " ▁ " ) ; track . Add ( temp . data , true ) ; } temp = temp . next ; } }