What are the differences between B trees and B+ trees?

后端 未结 14 2809
孤城傲影
孤城傲影 2020-12-02 03:18

In a b-tree you can store both keys and data in the internal and leaf nodes, but in a b+ tree you have to store the data in the

相关标签:
14条回答
  • 2020-12-02 04:06

    In B+ Tree, since only pointers are stored in the internal nodes, their size becomes significantly smaller than the internal nodes of B tree (which store both data+key). Hence, the indexes of the B+ tree can be fetched from the external storage in a single disk read, processed to find the location of the target. If it has been a B tree, a disk read is required for each and every decision making process. Hope I made my point clear! :)

    0 讨论(0)
  • 2020-12-02 04:09

    A B+tree is a balanced tree in which every path from the root of the tree to a leaf is of the same length, and each nonleaf node of the tree has between [n/2] and [n] children, where n is fixed for a particular tree. It contains index pages and data pages. Binary trees only have two children per parent node, B+ trees can have a variable number of children for each parent node

    0 讨论(0)
提交回复
热议问题