All Exams Test series for 1 year @ ₹349 only
Question

Consider $B^+$ tree in which the maximum number of keys in a node is 5. What is the minimum number of keys in any non-root node?

The correct answer is
2

The question asks for the minimum number of keys in a non-root node of a B+ tree, given that the maximum number of keys in a node is 5.

Understanding B+ Tree Properties

In a B+ tree, the structure is balanced, and nodes have specific rules regarding the number of keys and children:

  • Let $m$ be the maximum number of children a node can have (order of the tree).
  • The maximum number of keys a node can hold is $m - 1$.
  • The minimum number of keys in a non-root node is $ceil(m / 2) - 1$.
  • The minimum number of keys in the root node is 1 (unless it's the only node).

Calculating Minimum Keys

We are given that the maximum number of keys in a node is 5.

Using the property $Maximum keys = m - 1$:

$5 = m - 1$

Solving for $m$, we get:

$m = 5 + 1 = 6$

So, the maximum number of children a node can have is 6.

Now, we calculate the minimum number of keys required in any non-root node using the formula $Minimum keys = ceil(m / 2) - 1$:

$ \text{Minimum keys} = \lceil \frac{6}{2} \rceil - 1 $

$ \text{Minimum keys} = \lceil 3 \rceil - 1 $

$ \text{Minimum keys} = 3 - 1 = 2 $

Therefore, the minimum number of keys in any non-root node is 2.

Was this answer helpful?

Important Questions from Indexing

  1. In a relational database, a B+ Tree Index is to be constructed for a relation on a key field. In a B+ Tree, a Node Pointer points to a sub-tree and a Data Record Pointer points to a block of database records.

    Let, Node size = 4096 bytes, Node Pointer size = 10 bytes, Search Key Field size = 11 bytes and Data Record Pointer size = 12 bytes.

    The maximum number of Node Pointers that can be present in a non-leaf node of the B+ Tree is ________ . (Answer in integer)
  2. Consider a B+ Tree where the maximum number of key values in each leaf node is 2 and the maximum number of pointers in each non-leaf node is 3. Let the content of the B+ Tree be as shown in the figure.


    Which of the following options denotes the key value(s) stored in the root node after inserting a key value 3 in the given B+ Tree?

  3. An OTT company is maintaining a large disk-based relational database of different movies with the following schema: 

    Movie(ID, CustomerRating) 

    Genre(ID, Name) 

    Movie_Genre(MovieID, GenreID) 

    Consider the following SQL query on the relation database above: 

    SELECT * 

    FROM Movie, Genre, Movie_Genre 

    WHERE 

              Movie.CustomerRating > 3.4 AND 

              Genre.Name = “Comedy” AND 

              Movie_Genre.MovieID = Movie.ID AND 

              Movie_Genre.GenreID = Genre.ID; 

    This SQL query can be sped up using which of the following indexing options?

  4. Primary index in sequential order file organisation is also known as ______.

  5. The total cost of retrieving records in sorted order using an unclustered B+ tree is

    (P-Average number of records per data page

    N-Data pages

    F-Ratio of the size of a data entry to the size of a data record)

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App