Luxoft Interview Question

What is the cost of hash-code collision in HashMap? What if hashCode() return '1'?

Interview Answer

Anonymous

May 14, 2023

The HashMap performance will degrade and all keys end up storing in one bucket as a binary tree. The algorthnic complexity is O(log(n)) in this case

2