{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lec17a - Overflow Handling An overflow occurs when the home...

This preview shows pages 1–5. Sign up to view the full content.

Overflow Handling An overflow occurs when the home bucket for a new pair (key, element) is full. We may handle overflows by: ± Search the hash table in some systematic fashion for a bucket that is not full. Linear probing (linear open addressing). Quadratic probing. Random probing. ± Eliminate overflows by permitting each bucket to keep a list of all pairs for which it is the home bucket. Array linear list. Chain.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Linear Probing – Get And Put divisor = b (number of buckets) = 17 . Home bucket = key % 17 . 0481 2 1 6 61 2 2 9 34 28 11 23 7 03 3 30 45 Put in pairs whose keys are 6, 12, 34, 29, 28, 11, 23, 7, 0, 33, 30, 45
Linear Probing -- Remove 0481 2 1 6 61 2 2 9 34 28 11 23 7 03 3 30 45 remove(0) 2 1 6 2 2 9 34 28 11 23 7 45 33 30 Search cluster for pair (if any) to fill vacated bucket. 2 1 6 2 2 9 34 28 11 23 7 45 33 30

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Linear Probing – remove(34) 0481 2 1 6 61 2 2 9 34 28 11 23 7 03 3 30 45 2 1 6 2 2 9 28 11 23 7 3 30 45 Search cluster for pair (if any) to fill vacated bucket.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 15

lec17a - Overflow Handling An overflow occurs when the home...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online