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

Programming and data structure miscellaneous

Programming & Data Structure

  1. Consider the following 2 – 3 – 4 tree (i. e., B – tree with a minimum degree of two) in which each data item is a letter. The usual alphabetical ordering of letters is used in constructing the tree.

    What is the result of inserting G in the above tree?



    1. None of these
Correct Option: B

Since the given B tree is 2–3–4 tree, there can be at most 4 children or 3 keys. In B tree insertion, we start from root and traverse till the leaf node where key is to be inserted. While traversing. If we find a node which full, we split it. When we inseart G, we find root itself is full. So, we split it when we come down to left most leaf, we find that the leaf is also full, thus we split the leaf also. So, the percent node becomes H. L, P, U and select P as for splitting. Hence option (b) is correct.



Your comments will be displayed only after manual approval.