0% found this document useful (0 votes)
28 views14 pages

Key1 (X) Key2 (X) Keyn (X) (X)

B-trees are balanced search trees designed for secondary storage devices. They have properties including: every node stores keys in nondecreasing order and pointers to children; keys separate the ranges of keys in subtrees; all leaves are at the same depth/height; and nodes must contain a minimum and maximum number of keys. Operations on B-trees include insertion, deletion, and splitting nodes, with algorithms to maintain the tree structure during these operations.

Uploaded by

mansha99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views14 pages

Key1 (X) Key2 (X) Keyn (X) (X)

B-trees are balanced search trees designed for secondary storage devices. They have properties including: every node stores keys in nondecreasing order and pointers to children; keys separate the ranges of keys in subtrees; all leaves are at the same depth/height; and nodes must contain a minimum and maximum number of keys. Operations on B-trees include insertion, deletion, and splitting nodes, with algorithms to maintain the tree structure during these operations.

Uploaded by

mansha99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

B-trees are balanced search trees designed to work well on secondary

storage devices.
A B-treeTis a rooted tree (whose root is root[T]) having the following
properties:
1. Every node xhas the following fields:
a. n[x], the number of keys currently stored in node x,
b. the n[x] keys themselves, stored in nondecreasing order, so that
key1[x] key2[x] keyn[x][x],
c. leaf[x], a boolean value that is TRUE if xis a leaf and FALSE if xis
an internal node.

2. Each internal node xalso contains n[x]+1 pointers c1[x],c2[x],...,
cn[x]+1[x] to its children. Leaf nodes have no children, so their cifields are
undefined.


3. The keys keyi[x] separate the ranges of keys stored in each subtree: if ki
is any key stored in the subtree with root ci[x], then
k1 key1[x] k2 key2[x] keyn[x][x] kn[x]+1 .

4. All leaves have the same depth, which is the trees height h.

5. There are lower and upper bounds on the number of keys a node can
contain.

These bounds can be expressed in terms of a fixed integer t 2 called the
minimumdegreeof the B-tree:
a. Every node other than the root must have at least t 1 keys. Every
internal node other than the root thus has at least tchildren. If the tree is
nonempty, the root must have at least one key.
b. Every node can contain at most 2t 1 keys. Therefore, an internal node
can have at most 2tchildren. We say that a node is fullif it contains exactly
2t 1 keys.1



Operations on BTree

Insert Example




Deletion Example





Splitting Example


Insertion Algo


Deletion Algo

You might also like