database - What is the minimum number of a valid B+tree? -


i'm trying appeal on question had on exam other day, b+tree.

the question was:

consider b+tree l factor (assuming l positive , even), h>=0 height (the root considerto 0) , n>=1 number of records.

there 5 answers. 3 of them eliminated immediately, , had choose between these two:

  1. h>1 ==> n >= 0.5*l*(l+1). second direction not guaranteed: depends on arrival order of keys.
  2. none of above.

i chose (2) , lecturer says option (1). have following example think contradicts it:

                      7                /              \               3                9            /     \           /   \         1 2      3 4 5     7 8    9 10    

with l=4, , h=2:

  • does b+tree represent valid b+tree?
  • is lecturer wrong?

i appreciate here. example 1 base appeal on?

in general, minimum number of records n in b+tree height h , factor l?

well, apparently right... tree showed legal , contrasting lecturer's answer.

by inserting following keys in order: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , taking 6 out of tree create valid b+tree of height > 1 , n<10.

this contradicts h>1 ==> n >= 0.5*l*(l+1) rule in answer...

after many tries , lots of bureaucracy lecturer accepted answer , got points :)

thanks try @jonathan leffler...


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -