How can the height of a B+ tree change in different insertion orders?
For example, given n values and 2 different insert orders. What is the maximum difference I can get between the heights of the 2 built trees?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The best-case height of a B+-tree (or any B-tree) is logmn. The worst-case height is logm/2n. (Per Wikipedia)
The maximum difference you can get is
worstCase - bestCase, which is logm/2n – logmn, which reduces tologmn ( 1 / (1 – logm2) – 1)
(m represents the maximum number of children any one tree node can have)