Bottomline interview question

Difference between sets and list? Compare performance of treeMap and HashMap

Interview Answer

Anonymous

9 Aug 2024

List allow duplicates and sets does not search time in list - O(n) Search time in Sets - O(1) TreeMap stores data in ascending order of keys whereas hashmap does not Search, insert and delete time of hashmap is - O(n) TreeMap - O(log(n))