Starting from:
$30

$24

Lab # 4 B-trees Solution




The program b-tree.py in the class webpage contains implementations of basic B-tree tree operations, in-cluding insertion, search and display. Write functions to perform the following operations:




Compute the height of the tree



Extract the items in the B-tree into a sorted list.



Return the minimum element in the tree at a given depth d.



Return the maximum element in the tree at a given depth d.



Return the number of nodes in the tree at a given depth d.



Print all the items in the tree at a given depth d.



Return the number of nodes in the tree that are full.



Return the number of leaves in the tree that are full.



Given a key k, return the depth at which it is found in the tree, of -1 if k is not in the tree. As usual, write a report describing your work.

More products