M? ???? - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

M? ????

Description:

Title: B Author: thinkp2k Last modified by: User Created Date: 11/22/2005 9:50:05 AM Document presentation format: Other titles – PowerPoint PPT presentation

Number of Views:1
Avg rating:3.0/5.0
Slides: 21
Provided by: thin170
Category:
Tags: tree

less

Transcript and Presenter's Notes

Title: M? ????


1
M? ????
2
M?????
  • ? ?? ??? (m-1)?? ?? m?? ????? ??
  • 2?????? ???
  • ?? ??
  • ???? ??
  • ??, ??? ???

3
M?????? ??
n P1 K1 P2 K2 Pm-1 Km Pm
  • n of sub tree
  • Pi sub tree? ?? ???
  • Ki Key
  • Key?? ??? ????
  • Pi ? ???? ?????? ?? lt Ki
  • Pi1 ? ???? ?????? ?? lt Ki

4
B-Tree
5
B-Tree ??
  • ??? ?? ? ??? ?? m?, ?? ? m/2?? ?? ??? ??? ??(???
    leaf ??? ??. ??? ??2 ??. leaf??? ????? ??)
  • ????? ??? ??? ????? ??? ??
  • (?, ??? ??? ?? ???? ????? ??)
  • ?? leaf??? ?? level? ??? ??
  • (? ?? leaf??? ????? ?? ??? ??)
  • ??? ?? ?? ??? ????? ???? ?? ??? ?? ? m/2-1?, ??
    m-1???(???? ??)

6
??3? B-Tree
  • B-tree??? ??(search)
  • ?? key? ??
  • ???? ?? ?? B Tree
  • (??? ???? ?? file??? ??? ???)

7
??5? B-Tree? ?? ??
a
b
f
g
?
f
?
?
f
?
a
b
g
k
d
k
m
a
b
g
h
a) ?? a, g, f, b
b) ?? k
b) ?? d, h, m
?
?
?
?
?
?
f
j
f
j
i
r
s
g
h
a
b
d
k
m
g
h
k
m
a
b
d
e
e) ?? j
f) ?? e, s, I, r
8
??5? B-Tree? ?? ??
?
?
?
f
j
?
r
g
h
k
m
i
a
b
d
e
s
x
f) ?? x
?
?
?
c
f
?
j
?
r
a
b
d
e
g
h
i
k
l
m
n
s
t
u
x
g) ?? c, l, m, t, u
9
??5? B-Tree? ?? ??
?
?
j
?
?
?
c
f
?
?
?
m
r
a
b
d
e
g
h
i
s
t
u
x
k
l
n
p
h) ?? p
  • ?? Algorithm
  • ???? ?? ?? ?? ??
  • overflow split(?? Key?, ??? Key?) ?
  • Median?(m/2???) Parent node?
  • ??? ?? ? node?

10
B Tree
11
  • B-Tree (Knuth ??)
  • B-Tree? ??
  • ??, ???, ?? ??? ?? -gt node ? ??
  • ? node? ?? ??? Key??? ???
  • B-Tree? ?? Idea
  • Overflow ??? Split ?? ?? node? ???
  • ?? node? ?? Overflow?? ? node? ? node? ??
  • gt ? node? 2/3 ??? ???

12
?
?
km(j)


?
?
k(1)
?
k(2)
?

?
k(m-1)
p(1)
p(2)
p(m-1)
p(1)
p(2)
p(n)
?? M? B-????
??Overflow
C ? mn/2
?
?
k(c1)


?
?
k(1)
?
k(2)
?

?
k(c)
?
?
?
k(m)
k(c2)

?
?
k(j)
?
k(l)
?

?
k(n)
p(1)
p(2)
p(c)
p(h)
p(0)
p(c)
p(c1)
p(1)
B-??? ???? ??
13
Example
?
33
?
B-Tree? ??
?
?
?
22
33
?
18
?
?
20
?
22
?
26
?
?
35
24? ?? gt Overflow
18
20
24
26
35
18
20
22
24
26
33
35
c
???
?
?
24
?
?
?
18
20
?
22
?
?
?
26
33
?
35
14
? ?? node? ??? ??
?
?
k(a1)


?
k(ß1)
p(0)
k(1)
p(1)
k(a)
p(a)

p(a1)
k(a1)
k(ß)
p(ß)

p(ß1)
k(ß1)
k(2m)
p(2m)

???
15
Example
?
33
?
?
18
?
?
20
?
22
?
26
?
35
?
?
41
?
43
?
48
24? ?? gt Overflow
18
20
22
24
26
33
35
41
48
43
a
ß
???
?
?
?
22
35
?
?
?
24
26
?
33
?
?
?
41
43
?
48
?
?
?
18
20
16
B Tree
17
  • B-Tree (Knuth ??)
  • Index Part? Sequnce Set? ??
  • Index Part Leaf node? ?? ?? ??
  • Leaf node? ?? ???
  • Key ?? ?? (??? ??)
  • Sequence Set Leaf node? ??
  • Key?? ????? ??
  • -gt ??, ?? access? ????
  • ??, ??? B-Tree? ?? ??

18
B ??? ?
19
(b) ?? 4
(c) ?? 47
(a) ?? 16, 23
(d) ?? 8
(d) ?? 6
?? 3? B????? ?? ?? ?
20
(a)
(b) 62? ???? ??
(c) 17? ????(??) ??
(d) 73? ????(??) ??
?? 5? B????? ?? ?? ?
Write a Comment
User Comments (0)
About PowerShow.com