how do you decide when to use hashmap and when to


How do you decide when to use HashMap and when to use TreeMap?

When we want to perform deletion, insertion and locate elements in a Map then HashMap is used.

Whereas TreeMap is used when we want to traverse elements in a sorted order. Depending upon size of collection, adding elements to HashMap is easy. But for sorted elements traversal we can convert HashMap into TreeMap.

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: how do you decide when to use hashmap and when to
Reference No:- TGS0355110

Expected delivery within 24 Hours