Search code examples
algorithmb-tree

B-Tree, difficulties to understand


I need to find out what would be the keys contained in the final level of data-bearing nodes if I insert value in increasing order in it. My BTree is of order 3, and I would like to know how to plot it, if insert values from 0 to 15.
Thanks in advance for help,
eo


Solution

  • B-Tree with max key size of 3. The order depends of definition, "Bayer & McCreight 1972" or "Knuth 1998".

    └── 3, 7, 11
        ├── 0, 1, 2
        ├── 4, 5, 6
        ├── 8, 9, 10
        └── 12, 13, 14
    

    B-Tree Java source