written 7.9 years ago by | • modified 7.9 years ago |
Mumbai University > Information Technology > Sem 3 > Data structure and algorithm analysis
Marks: 5M
Year: Dec 2015, May 2016
written 7.9 years ago by | • modified 7.9 years ago |
Mumbai University > Information Technology > Sem 3 > Data structure and algorithm analysis
Marks: 5M
Year: Dec 2015, May 2016
written 7.9 years ago by |
B-Tree is a self-balancing search tree. In most of the other self-balancing search trees (like AVL and Red Black Trees), it is assumed that everything is in main memory. To understand use of B-Trees, we must think of huge amount of data that cannot fit in main memory. When the number of keys is high, the data is read from disk in the form of blocks. Disk access time is very high compared to main memory access time. The main idea of using B-Trees is to reduce the number of disk accesses. Most of the tree operations (search, insert, delete, max, min, ..etc ) require O(h) disk accesses where h is height of the tree. B-tree is a fat tree. Height of B-Trees is kept low by putting maximum possible keys in a B-Tree node. Generally, a B-Tree node size is kept equal to the disk block size. Since h is low for B-Tree, total disk accesses for most of the operations are reduced significantly compared to balanced Binary Search Trees like AVL Tree, Red Black Tree, ..etc.
Properties of B-Tree
Following is an example B-Tree of minimum degree 3. Note that in practical B-Trees, the value of minimum degree is much more than 3.