Homework 8
Document last modified:
For example:
Disk_Read( x )
reads the keys and children pointers of node x.
Disk_Read ( ci[ x ])
reads the keys and children pointers of node ci[ x ].
a) Modify the algorithm to implement a more realistic assumption that only the root and the current node is held in memory.
b) What is the number of disk accesses for your traversal method on Figure 18.7e? Assume only the root and the current node are in memory.
| void B_Tree_Traverse (Node x) // pre: x points to root node of subtree if leaf[ x ] then
// at a leaf, print |
Disk_Read( x )
reads the keys and children pointers of node x.
Disk_Read ( ci[ x ])
reads the keys and children pointers of node ci[ x ]
b) What is the number of disk accesses for your traversal method on Figure 18.7e? Assume the root and height nodes are always in memory.
c) What is a good estimate of the maximum number of disk accesses for your traversal on a B-tree in general in terms of t and h? Examine the recursion tree in Figure 18.4 to help understand the order of growth.
Turn in