Post your solutions to the Feb 5 In-Class Exercise to this thread.
Best,
Chris
Block 1: {22, 10} Block 2: {55, 35} Block 3: {70, 5}
Read 22 into memory, this will swizzle left pointer of 22 which points to 10. We look at 10 and decide to read 5 into memory, this swizzles the left pointer of 10 which points to 5.
Block 1 contains two records of key 22 and 10.
Block 2 contains two records of key 55 and 35.
Block 3 contains two records of key 70 and 5.
First read block 1 into memory, reference to record of 10 will be swizzled.
Then read block 3 into memory, reference to record of 5 from record of 10 will be swizzled.
Notice that block 2 is not read into memory.
If we do a lookup of the table record corresponding to the key 5, block 1 and 3 would be read in and swizzling.
Block 1 - 22 | 10
Block 2 - 55 | 35
Block 3 - 70
Block 4 - 5
Searching for 5:
Read Block 1
Swizzle 22 left pointer
Stay in Block 1
Read Block 4
Swizzle 10 left pointer
(Edited: 2020-02-05)I read record 22 in block 1. 22's left pointer 10 is read into memory so it gets swizzled. I read 10's left pointer 5 from block 3. 10's left pointer 5 is read into memory so it gets swizzled. ~