MZ interview question

What's the best case time complexity for a hash table insertion?

Interview Answer

Anonymous

15 Feb 2016

O(1) if in the pair value is just a variable...... O(n) in case the value is ArrayList/LinkedList : its very common to avoid the collision and to save the memory. 'n' is the max length of bucket/list at 'value'