How many elements can be held in a B-tree of order n?

前端 未结 4 1408
面向向阳花
面向向阳花 2021-02-03 13:23

Is it 2n? Just checking.

4条回答
  •  渐次进展
    2021-02-03 14:09

    If your formula for the number of elements doesn't include an exponentiation somewhere, you've done it wrong.

    A binary tree of order 5 can hold 2^0 + 2^1 + 2^2 + 2^3 + 2^4 elements, so 31 .. (which is 2^order - 1).

    Edit: I appear to have gotten order and depth / length mixed up. What on earth is the order of a binary tree? You appear to discuss B-trees as if they don't, by the very nature of their definition, hold a maximum of two child elements per element.

提交回复
热议问题