General Idea

Cards (2)

  • The ideal hash table data structure is merely an array of some fixed size, containing the items. Generally a search is performed on some part (that is, data field) of the item. This is called the key.
  • Each key is mapped into some number in the range 0 to TableSize – 1 and placed in the appropriate cell. The mapping is called a hash function, which ideally should be simple to compute and should ensure that any two distinct keys get different cells.