Lab # 4 B-tree solution

$30.00

Description

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:

  1. Compute the height of the tree

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

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

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

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

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

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

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

  1. 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.


error: Content is protected !!