A B-tree of order 4 and of height 3 will have a maximum of _______ keys.

Category: QuestionsA B-tree of order 4 and of height 3 will have a maximum of _______ keys.
Editor">Editor Staff asked 5 months ago

A B-tree of order 4 and of height 3 will have a maximum of _______ keys.
 
(a) 255
 
(b) 63
 
(c) 127
 
(d) 188
 
I would like to ask this question from B-Trees in portion B-Trees of Data Structures & Algorithms I
 
I had been asked this question during an interview for a job.

1 Answers
Editor">Editor Staff answered 5 months ago

The correct choice is (a) 255
 
Easiest explanation – A B-tree of order m of height h will have the maximum number of keys when all nodes are completely filled. So, the B-tree will have n = (m^h+1 – 1) keys in this situation. So, required number of maximum keys = 4^3+1 – 1 = 256 – 1 = 255.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702