Exercises

  1. Consider that a secondary-level index with 10,400 blocks needs to be represented using multi-level linear indexing. The blocking factor is 52 entries per block, which is also the fan-out factor for multi-level indexing:
    • How many levels are required for indexing?
    • How many blocks are required at the second level?
    • What would be the minimum blocking factor to fit the dataset using a second-level linear index?
  2. Write the code for deletion of an element from a 2-3 tree. Also, prove that the number of leaf nodes in a 2-3 tree with height h will be between 2h-1 and 3h-1.
  3. Assume a computer system with disk blocks of 8,192, and that you want to store records with 16-byte keys and 64-byte fields. What will be the greatest number of records that can be stored in a file if a linear index of size 4 MB is used?Assume the records are sorted and packaged sequentially into the disk file.
  4. In the balanced binary tree given in the figure that follows, how many nodes will become unbalanced when inserted as a child of the node g?

    Exercises

    Figure 7.22: Balanced binary tree

  5. Illustrate what the insertion of 1, 3, 6, 2, 7, 9, 10 (in same order) into a B+ tree will look like.
  6. Suppose N is an interior node whose capacity is m keys and m+1 leaves. Let m be assigned the m+2 leaf because of leaf splitting below which leads to the creation of a new node m which will be siblings to immediately to its right of m.
  7. Write a program to create and manage a B+ tree. The program should implement the following operations: creation, insertion, deletion, and tree display.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset