Definition of B-Trees Properties Specialization Examples 2-3 Trees Insertion of B-Tree Remove Items From B-Tree
Definition of B-Trees Properties Specialization Examples 2-3 Trees Insertion of B-Tree Remove Items From B-Tree
Definition of B-Trees Properties Specialization Examples 2-3 Trees Insertion of B-Tree Remove Items From B-Tree
Introduction
Definition of B-trees
Properties
Specialization
Examples
2-3 trees
Insertion of B-tree
Remove items from B-tree
B-Trees
B-Trees
Definition
A balanced search tree in which every node has
between m/2 and m children, where m>1 is a
fixed integer. M is the order. The root may have as
few as 2 children. This is a good structure if much
of the tree is in slow memory (disk), since the
height, and hence the number of accesses, can be
kept small, say one or two, by picking a large m.
M is the height of a tree, the maximum number of
children of nodes in a B-tree.
A B-tree of order M with the following
properties
Adding a record when both the leaf
page and the index page are full
As our last example, we're going to add a record
containing a key value of 95 to our B+ tree. This record
belongs in the page containing 75, 80, 85, and 90. Since
this page is full we split it into two pages:
Left Leaf Page Right Leaf Page
75 80 85 90 95
The middle key, 85, rises to the index page.
Unfortunately, the index page is also full, so
we split the index page:
Left Index Page Right Index Page New Index Page
25 50 75 85 60
The following table illustrates the addition of the record containing 95 to
the B+ tree.
Deleting Keys from a B+ tree
As our example, we consider the B+ tree after we
added 95 as a key. As a refresher this tree is
printed in the following table.
Delete 70 from the B+ Tree
We begin by deleting the record with key 70
from the B+ tree. This record is in a leaf page
containing 60, 65 and 70. This page will
contain 2 records after the deletion. Since our
fill factor is 50% or (2 records) we simply
delete 70 from the leaf node. The following
table shows the B+ tree after the deletion.
Delete Record with Key 70
Delete 25 from the B+ tree
contain 1 or 2 keys
a node a specialization of 2-3 tree
all leaf nodes are at the same depth
all non-leaf nodes(except the root)
have either a key or two subtresss, or 2
keys and three subtree.
it is not a binary tree