HashMap that will store the elements of the lists with their counts
SortedDictionary < int , int > hmap = new SortedDictionary < int , int > ( ) ; Node n1 = head1 ; Node n2 = head2 ; LinkedList result = new LinkedList ( ) ;