Driver code
public static void main ( String [ ] args ) { LinkedList ll = new LinkedList ( ) ; ll . insert ( 53 ) ; ll . insert ( 53 ) ; ll . insert ( 49 ) ; ll . insert ( 49 ) ; ll . insert ( 35 ) ; ll . insert ( 28 ) ; ll . insert ( 28 ) ; ll . insert ( 23 ) ; System . out . println ( " Before ▁ removal ▁ of ▁ duplicates " ) ; ll . printList ( ) ; ll . removeAllDuplicates ( ) ; System . out . println ( " After removal of duplicates "); ll . printList ( ) ; } }