News for hackers. Stuff that matters.
Re:Google Interview University – Plan for studying to become... by lkitching on Thursday October 06, 2016 @10:44AM (#12652845)
You don't need hash codes to be unique for items in the table so there doesn't need to be any relation between the size of the hash and the size of the table. The time taken by the hash function depends on the size of the keys not the size of the table.
Re:Google Interview University – Plan for studying to become... by rand_r on Thursday October 06, 2016 @10:49AM (#12652907)
If they're not unique, it will have to linearly search through items with duplicate keys. This situation will begin to approach O(n) time, which isn't good.
Re:Google Interview University – Plan for studying to become... by krona on Thursday October 06, 2016 @11:07AM (#12653101)
Unless you're using an Open addressing scheme like cookoo which ensures constant lookup time in the worst case