






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







REMEMBER: Trees that are balanced (have minimum height for a given node count) are more quickly searched. Balanced trees serve as efficient indices into databases and other collections of indexed records. The BāTree and its derivative data structures allow for very efficient indexing. The BāTree comprises a data structure and associated insertion and deletion algorithms. One suspects that deletion would be done by āLazy Deletionā, marking as deleted. The BāTree data structure contains two types of nodes: index nodes and data nodes. Index nodes are also called āinterior nodesā. Unlike a binary tree, the interior nodes of a BāTree do not contain data values. These interior nodes contain copies of the key values from some of the data nodes. These key values are used by the index structure in efficient location of the data nodes.
In a BāTree of Order M, index nodes have M pointers and (M ā 1) keys Example: An Index Node (Interior Node) for BāTree of Order 4 P 0 points to records with key values K < K 1. For 1 ļ£ J ļ£ (M ā 2), here 1 ), here 1 ļ£ J ļ£ 2), here 1 PJ points to records with key values KJ ļ£ K < KJ+1. PM-1, here P 3 , points to records with key values K ļ³ K 3. Unless the index node is the root node of the BāTree, there will be additional constraints placed on the records pointed to by P 0 and PMā1. All BāTree variants of Order 4, such as a B+ Tree, would have the same structure for interior nodes.
All variants of BāTrees, including the B+ Tree, follow the same balance constraints. These constraints are enforced by the algorithm to insert new keys into the tree. A BāTree of order M ļ³ 2), here 1 satisfies the following requirements.
Leaf Nodes may contain data, but usually contain pointers to data records (as indicated here). The data are most commonly stored on a disk. These pointers may actually be implemented as addresses on the disk used to store the data files. Note the major structural difference between the index nodes and leaf nodes in a BāTree of order M. The maximum counts are as follows. Index nodes: (M ā 1) keys and M pointers Leaf nodes: (M ā 1) keys and (M ā 1) pointers, one for each key.
Binary Tree Data stored in interior nodes BāTree (also B+ Tree) Interior nodes (index nodes) store only indices. Any given index value may also be a data value, but is not required to be. Leaf nodes store either the data or pointers to the data.
Leaf Node Interior Node 3 keys 3 keys 3 pointers 4 pointers Insert āAā, āBā, āCā, āDā, āEā, and āFā (in that order) into the BāTree Insert āAā. This creates the BāTree. At this point, the tree is just a single node.
Insert āEā Insert āFā ā This causes another split.