![]() ![]() keySet ( ) for ( String string : strings ) If we create a HashMap instance like below and show the order of keys HashMap hs = new HashMap ( ) load facotr should offer a good tradeoff between space and time costsģ.Why we say fail-fast in HashMap is a best-effort operation?.initial capacity should take the expected number of entries and load factor into account to minimize the number of rehash.When the number of hash entries exceeds the production of load factor and current capacity, the hash table is rehashed and capacity is doubled ![]() Load factor : a measure of how full the hash table is allowed to get before its capacity grows ![]() Initial capacity : the number of buckets in the Hashtable when HashMap is created O ( 1 ) 2.What affects the efficiency of HashMap?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |