CSE 214 Lecture Notes - Lecture 77: Hash Table, Double Hashing, Linear Probing

181 views4 pages

Document Summary

Data records are stored in a hash table. Position of a data record in the has table is determined by its key. A hash function maps the keys to positions in the hash table. If a has function has 2 keys in the same position, a collision occurs. Key k is a string(or object) k. hashcode() % tablesize. During insert of key k to position p. If position p contains a different key, check p+1 etc. If position p contains a different key then do p+1, p+4, p+9. Load factor of a hash table is given by the formula. = number of elements in a table/size of table. If a key is removed , leave the boolean value set at true so we can search past it. If hash table is full, it costs a lot to resize and rehash every single object. Return several digits in the middle of the result. Multiply the integer by a constant less than 1.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents