You are on page 1of 3

B+Tree

Deletion
o STEP 1 Find leaf L containing (key.pointer) entry to delete

o STEP 2 Remove entry from L

STEP 2a If L meets the "half fuil" criteria, then we're done.


STEP 2b Otherwise, L has too few data entries.

o STEP 3 If L's right sibling can spare an entry, then move smallest entry in right sibling to L
STEP 3a Else, if L's left sibling can spare an entry then move largest entry in left sibling to L
STEP 3b Else, merge L and a sibling

STEP 4 If merging, then recursively deletes the entry (pointing tol or sibling) from the parent.

o STEP 5 Merge could propagate to root, decreasing height

SCROLL TO TOP
Deletion /P-70
Case 1: Where Data Page Not full &Indexpage Not full

S 10 15 20 2 2 30U o S5 O
Before Deletion

After Deletion

Deletion /P-25
Case 2: Where Data Pagefull &Index page Not full

10 15 2 25 28 30 S
Before Deletion
|L
After Deletion

Deletion I/P-60
Case 3: Where Data
Page full& Index page Not full

51015 20 28 30 50 ss 6065 70 75 80 85 90 95
Before Deletion

510 15 20 230 5s5 7 59095


After Deletion

Program
#include«stdio.h>
#include<conio.h>
#include<iostream>
using namespace std;
struct BplusTreeNode

int data;

CCPOILL TO TOP child_ptr;

You might also like