Pergunta de entrevista da empresa Bottomline

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

Resposta da entrevista

Sigiloso

9 de ago. de 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))