Unit-5 : Collections
ArrayList supports dynamic arrays that can grow or shrink as needed. The ArrayList class implements the List interface. Can contain duplicate elements. Maintains insertion order. Non synchronized. Manipulation is slow . LinkedList class uses a doubly linked list to store the elements. It implements the List interface. Can contain duplicate elements. Maintains insertion order. Non synchronized. Manipulation is fast HashSet class is used to create a collection that uses a hash table for storage. It implements the Set interface. Contains unique elements only. Allows null value. Non synchronized. HashSet doesn't maintain the insertion order. HashSet is the best for search operations TreeSet class implements the Set interface that uses a tree for storage. Contains unique elements only like HashSet. Access and retrieval times are quiet fast. Doesn't allow null element. Non synchronized. Maintains ascending order. // 6 methods from collection/ ArrayL...