Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. (a) Suppose you are given an empty B+-tree where each node (leaf and internal) can store up to 5 key values. Suppose values 1, 2,... 10 are inserted, in order, into the tree, show the tree pictorially
    (i) After 6 insertions, and
    (ii) After all 10 insertions
    Do NOT show intermediate stages.
    (b) Suppose instead of splitting a node when it is full, we try to move a value to the left sibling. If there is no left sibling, or the left sibling is full, we split the node. Show the tree after values, 1, 2,..., 9 have been inserted. Assume, as in (a) that each node can hold up to 5 keys.
    (c) In general, suppose a B+-tree node can hold a maximum of m keys, and you insert a long sequence of keys in increasing order. Then what approximately is the average number of keys in each leaf level node.
    (i) In the normal case, and
    (ii) with the insertion as in (b).
    1. 2m , 13 , m / 2
    2. m - 1 , 5 , m / 2
    3. m / 2 , 13 , 0
    4. None of the above
Correct Option: D

(a)

(b)

(c)

(i)
m
or
m
22

(ii) m



Your comments will be displayed only after manual approval.