Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
60 views

B+ Tree Dbms

This document provides information about B+ trees, which are a data structure used to implement database indexes. B+ trees have internal nodes that contain keys and pointers to lower level nodes or leaf nodes. All data is stored only in the leaf nodes. B+ trees are balanced trees where every path from the root to a leaf is the same length. The document describes the structure and characteristics of B+ trees, and provides examples of how to insert and delete keys from a B+ tree.

Uploaded by

Ram Nath
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

B+ Tree Dbms

This document provides information about B+ trees, which are a data structure used to implement database indexes. B+ trees have internal nodes that contain keys and pointers to lower level nodes or leaf nodes. All data is stored only in the leaf nodes. B+ trees are balanced trees where every path from the root to a leaf is the same length. The document describes the structure and characteristics of B+ trees, and provides examples of how to insert and delete keys from a B+ tree.

Uploaded by

Ram Nath
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

B+ Trees

Prepared by
Hamid ali Dana
CS & IT Ajk university Mzd
From Gilgit Baltistan
What is b+ tree
A B+ tree is a data structure often used in the
implementation of database indexes. Each
node of the tree contains an ordered list of keys
and pointers to lower level nodes in the tree.

A B+ tree is a balanced tree in which every


path from the root of the tree to a leaf is of the
same length.
B+- Tree Characteristics
• Data records are only stored in the leaves.
• Internal nodes store just keys.
• All data is stored at the leaf nodes (leaf pages); all
other nodes (index pages) only store keys.
• All the leaf nodes are interconnected with each other
leaf nodes for faster access.
• Keys are used for directing a search to the proper leaf.
• If a target key is less than a key in an internal node,
then the pointer just to its left is followed.
• If a target key is greater or equal to the key in the
internal node, then the pointer to its right is followed.
• B+ Tree combines features of ISAM (Indexed
Sequential Access Method) and B Trees.
B+ TREE
INTERNAL NODE / INDEX nodeS

LEAF NODES / DATA nodeS

The linked list allows rapid traversal.


Structure of b+ tree
How to create or insert in B+:
==2,4,7,10,17,21,28
if n=4 n is the order
key=n-1=4-1=3

2
==2,4,7,10,17,21,28

2 4
==2,4,7,10,17,21,28

2 4 7
==2,4,7,10,17,21,28

2 4 7 10
==2,4,7,10,17,21,28

4 7

2 4 7 10 17
==2,4,7,10,17,21,28

4 7 10

2 4 7 10 17 21
==2,4,7,10,17,21,28

4 10 17

2 4 7 10 17 21 28
Deletion Process:
Deletion of 28:
7

4 10 17

2 4 7 10 17 21 28
Deleted 28:

4 7 10

2 4 7 10 17 21
Deletion of 4:

4 7 10

2 4 7 10 17 21
Deleted 4:
7 10

2 7 10 17 21
Deletion of 7:
7 10

2 7 10 17 21
Deleted 7:
10

2 10 17 21
Deletion of 2:
10

2 10 17 21
Deleted 2:

10 17 21
Thank you

You might also like