February 14, 2017

[HDGEM] A hash table can trade space for speed

We can reduce the look up time from O(n) to O(1) by trading space for speed. A hash table is built exactly for this purpose, it supports fast look up in near constant time. 

I say "near" because if a collision occurred, a look up could degenerate to O(n)time. But look up in hash table should be amortized O(1) time as long as the hash function was chosen carefully.

Posted By Blogger to HDGEM at 2/14/2017 03:51:00 AM
Post a Comment

Featured Post

The new Dell XPS 13’s overall design is 30% thinner and lighter than its predecessor

The new Dell XPS 13 has twice the performance of the XPS 13 launched in 2015, as well as improved battery life that should enable the model...