preview

Importance Of B Tree

Satisfactory Essays

B-TREES
B-tree is a tree data structure that keeps data sorted and allows searches, insertions, and deletions in logarithmic amortized time. The main idea of using B-Trees is to reduce the number of disk accesses.
It is optimized for systems that read and write large blocks of data
B- trees are:
• Balanced – It is a self-balancing data structure, which means that performance can be guaranteed when B-Trees are utilized. • Broad –B-Trees are broad and expand horizontally instead of vertically. The height of B-Trees is kept low by putting maximum possible keys in a B-Tree node. Since h is low the total disk accesses for most of the operations are reduced significantly.
• Dependent on a positive constant integer called MINIMUM, which is …show more content…

Clearly, the running time of B-Tree-Create is O(1), dominated by the time it takes to write the node to disk.
Inserting in B-Tree .
Inserting into a B-tree means we have to find a place to put the new key. The general algorithm for inserting a key k into a B-tree T.
B-Tree-Insert (T, k) r = root[T] if n[r] = 2t - 1 then // uh-oh, the root is full, we have to split it s = allocate-node () root[T] = s // new root node leaf[s] = False // will have some children n[s] = 0 // for now c1[s] = r // child is the old root node B-Tree-Split-Child (s, 1, r) // r is split B-Tree-Insert-Nonfull (s, k) // s is clearly not full else B-Tree-Insert-Nonfull

Get Access