Professional Documents
Culture Documents
302 B+tree Ind Hash
302 B+tree Ind Hash
B+ Tree Properties
B+ Tree Searching
B+ Tree Insertion
B+ Tree Deletion
Static Hashing
Extendable Hashing
Questions in pass papers
B+ Tree Properties
B+ Tree Properties
Balanced Tree
K1
P1
P2
K2
P3
K1
P1
P2
K2
Kn-1
Pn-1
Pn
B+ Tree Properties
Tutorial 8.1
Non-leaf Node
K1 K2
Each key-search values in subtree Si
P1 P2 P3
pointed by Pi < Ki, >=Ki-1
Key values in S1 < K1
S1 S2 S3
K1 <= Key values in S2 < K2
Leaf Node
P3
K1 K2
Pi points record or bucket with P
P
search key value Ki
Record of K1 Record of K2
Pn points to the neighbor leaf
Record of K2
node
B+ Tree Searching
Tutorial 8.2
Given a search-value k
Start from the root, look for the largest searchkey value (Kl) in the node <= k
Follow pointer Pl+1 to next level, until reach a
Kl<=k<Kl+1
leaf node
K1 K2 Kl Kl+1
Kn-1
P2
P1
P3
Pn-1
Pn
Pl+1
If k is found to be equal to Kl in the leaf, follow
Pl to search the record or bucket
K K
l
Record of Kl
Record of Kl
Pl
l+1
k = Kl
B+ Tree Insertion
Tutorial 8.3
Overflow
When number of search-key values exceed n-1
7
9
13 15 Insert 8
Leaf Node
Split into two nodes:
1st node contains (n-1)/2 values
2nd node contains remaining values
Copy the smallest search-key value of the 2nd node
to parent node
9
7
13
15
B+ Tree Insertion
Tutorial 8.3
Overflow
When number of search-key values exceed n-1
7
9
13 15 Insert 8
Non-Leaf Node
Split into two nodes:
1st node contains n/2 -1 values
Move the smallest of the remaining values, together
with pointer, to the parent
2nd node contains the remaining values
9
7
13
15
Tutorial 8.3
B+ Tree Insertion
7
1
7
1
10
17
7
10
17
21
B+ Tree Insertion
1, 4, 7, 10, 17, 21, 31, 25, 19, 20, 28, 42
17
7
1
25
10
17
21
25
31
17
7
1
20
10
17
19
25
20
21
25
31
B+ Tree Insertion
Tutorial 8.3
4
7
20
17
10
25
31
19
20
31
21
25
28
42
Tutorial 8.3
B+ Tree Insertion
Leaf
A
10
4
2
8
4
10
Subtree
C
Leaf
B
Subtree
D
B+ Tree Deletion
Tutorial 8.4
Underflow
Delete 10
10
Leaf Node
Redistribute to sibling
Right node not less than left node 9
Replace the between-value in parent
by their smallest value of the right
node
Merge (contain too few entries)
9
Move all values, pointers to left node
Remove the between-value in parent
13
9
10
18
13
10
14
13
22
13
18
14
18
13
14
22
13
14
14
16
18
16
B+ Tree Deletion
Tutorial 8.4
9
Delete 10
10
Non-Leaf Node
Redistribute to sibling
Through parent
9
Right node not less than left node
Merge (contain too few entries)
Bring down parent
Move all values, pointers to left 9
node
Delete the right node, and pointers
in parent
13
9
10
18
13
10
14
18
16
13
14
14
15
15
16
18
13
22
14
18
22
16
16
B+ Tree Deletion
Tutorial 8.4
20
Subtree
A
20
Subtree
A
Tutorial 8.4
B+ Tree Deletion
17
25
10
17
19
20
31
50
21
25
28
31
20
17
10
25
17
19
20
21
50
25
31
42
42
B+ Tree Deletion
Tutorial 8.4
10
17
17
10
20
50
17
19
20
50
17
20
42
25
42
Static Hashing
Tutorial 8.5
Hash function h
Brighton
A-217
750
Round Hill
A-305
350
.
.
.
.
i1
8.6
i2
bucket2
Bucket address table
i3
bucket3
8.6
2
00
01
10
11
000
001
010
011
100
101
110
111
8.6
3
000
001
010
011
100
101
110
111
8.6
100
111
000
0
1
4
2
00
1
0
101
01
10
11
1
1
4
5
1
8
2
4
5
2
7
2
010
20
100
8.6
inserting 1, 4, 5, 7, 8, 2, 20
1
001
4
100
5
101
7
111
8
000
2
010
20
100
2
3
2
00
000
1
8
1
8
001
010
01
10
11
011
100
101
4
5
110
2
7
111
3
4
20
3
5
2
7
Tutorial 8.7
1
1
8
00
01
10
4
5
11
2
7
Tutorial 8.7
2
3
000
1
8
001
010
011
100
101
110
111
3
4
20
3
5
2
7