Search code examples
data-structureskeydefinitionb-tree

What exactly does "key" mean, in the context of B-Trees?


Say we have a B-Tree with the following structure:

           [5] [10]
          /   |    \
    [1][2]  [6][8]  [11][14]

Is it appropriate to say that 5 and 10 are the "keys" for the buckets at the bottom of the tree? Or am I totally missing the definition of "keys" for B-trees?


Solution

  • Generally, tree structures store a collection of values called keys. In the above tree, all the listed numbers are keys. He term keys is appropriate since trees often store key/value pairs and the balancing and lookup logic only applies to keys.

    Hope this helps!