Boston University



h("if") = 2 = 00000010
h("case") = 4 = 00000100



h("if") = 2 = 00000010
h("case") = 4 = 00000100
h("class") = 5 = 00000101


A. bucket 0
B. bucket 1 ← yes: the rightmost i bits are 01
C. bucket 2
h("if") = 2 = 00000010
h("case") = 4 = 00000100
h("class") = 5 = 00000101
h("continue") = 8 = 00001000
h("for") = 3 = 00000011
(11 = 3 is too big, so use 1)
h("extends") = 7 = 00000111








h("class") = 5 = 00000101 (leave where it is)
h("for") = 3 = 00000011 (move to new bucket)
h("extends") = 7 = 00000111 (move to new bucket)










which bucket should be rehashed?
A. bucket 0 ← yes: 4 = 100, and items that should now be in that bucket were put in 000 = 0 (using the rightmost i – 1 bits)
B. bucket 1 C. bucket 2 D. bucket 3
"toString": h("toString") = 8 = 00001000
"private": h("private") = 7 = 00000111
"interface": h("interface") = 9 = 00001001






which bucket should be split/rehashed? ← new bucket is 5 = 101, so rehash bucket 001