Since all elements of are smaller than each element of , and and are Min-Heaps, we know:
for :
Since , and the structure is the same as , this part fulfills the min-heap properties.
for :
Since B is a min-heap, for every element with , we know that this part of also fulfills the min-heap properties, because
Thus, is also a Min-Heap.
Cuckoo hashing
1.) Inserting the keys 27, 2, and 32:
27:
0
1
2
3
4
2:
0
1
2
3
4
32:
0
1
2
3
4
->
0
1
2
3
4
2.) Infinite Sequence
With the Cuckoo hashing technique we can store at most two keys with the same and value. Since and already have the same values, any third number with the same and values would lead to an infinite sequence.
needs to fulfill the following two conditions:
in :
in :
With we have , for , and we could choose e.g. and the third number
-> would lead to an infinite sequence