Chapter 8
These are the solutions to the Exercises.
-
There are a total of 128 I/Os. We can arrive at this either through analyzing the diagram or by plugging the numbers into our Big O expression. Let’s do both!
At the top level of the diagram, we can see that we take 256 items and load them into main memory. Since each block holds 4 items, this means we’ll have to load a total of 64 blocks since 256/4=64. Since it takes one I/O to load one block, this means we perform 64 I/Os.
At the next level, we take the same 256 items again (this time, in the form of 4 sublists that each contain 64 items) and load them into memory. As with the top level, this, too, will take 64 I/Os.
At this point, the algorithm is complete. It comes out that we performed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access