- ?s?????s - PowerPoint PPT Presentation

About This Presentation
Title:

- ?s?????s

Description:

- (balanced binary trees) m- – PowerPoint PPT presentation

Number of Views:12
Avg rating:3.0/5.0
Slides: 31
Provided by: admin1219
Category:
Tags: trees

less

Transcript and Presenter's Notes

Title: - ?s?????s


1
??µ?? ?ed?µ????
  • - ?s?????sµ??a ??ad??? ???d?a (balanced binary
    trees)
  • ???d?a ??a??t?s?? m-d??µ??
  • ????d??stata ???d?a (multidimensional trees)

2
???sµ??
  • st???e?? (??µß??)
  • a?µ?
  • ?p?d??d??
  • pa?d??, ??????, p???????, ap??????
  • µ???p?t?
  • ???? (ß????)
  • ep?ped?
  • f???a, es?te????? ??µß??

3
Stat??? a?apa??stas? d?ad???? d??d??? (µe p??a?a)
  • ?as??eta? st?? p??????µe?? ?d??t?ta (t??
    s?µp????µ???? d?ad???? d??d???)
  • ???ß??µa spat??? ????? ?ta? ?e?p??? p????
    st???e?a (??a ?a ???e? t? d??d?? p???e?)
  • ??a d??d?? µe n st???e?a ?a µp????se ?a apa?t?se?
    p??a?a µe?????? µ???? ?a? 2n-1 (? pe??pt?s? t??
    de???? ????? d?ad???? d??d???)

4
S??dedeµ??? a?apa??stas? d?ad???? d??d??? (µe
de??te?)
  • ? p?? d?µ?f???? ???p???s?
  • ???e st???e?? a?t?st???e? se ??a ??µß? µe ??a
    ped?? ded?µ???? (data) ?a? d?? ped?a s??d?sµ??
    (LeftChild, RightChild)

5
???s??s? d??d??? (s??.)
  • ???d?ateta?µ??? A, B, D, C, E, G, F, H, I
  • ?etad?ateta?µ???D, B, G, E, H, I, F, C, A
  • ??d?d?ateta?µ???B, D, A, G, E, C, H, F, I
  • ?at? se??? ep?p?d??A, B, C, D, E, F, G, H, I

6
??a??af? st???e??? ap? ??? (1)
  • 3 pe??pt?se??
  • ? ??µß?? p (p?? pe????e? t? st???e??) e??a? f????
  • ?? p ??e? µ??? ??a µ? ?e?? ?p?d??d??
  • ?? p ??e? a???ß?? d?? µ? ?e?? ?p?d??d?a

7
???a?? ???d??
8
?pa??de?t? !
9
??a ?a??te?? ???d??
10
?s?????sµ??a ???d?a
  • St????
  • ?a µ?? af?s??µe t? ??a ??ad? t?? d??d??? ?a ???e?
    ?at? p??? µe?a??te?? t?? ?????. ?a d?? ?p?d??d?a
    ?????µe ?a ????? pe??p?? t? ?d?? ????.

11
? ??s?
  • ???d?a AVL
  • Adel'son
  • Vel'skii
  • Landis

12
???d?a AVL
  • ? d?af??? t?? ???? t?? a??ste??? ?a? t?? de????
    ?p?d??d??? de? p??pe? ?a ?epe??? t? 1. ??t?
    p??pe? ?a ?s??e? a?ad??µ??? ??a ????? t???
    ??µß??? t?? d??d???.

13
???d?a AVL
  • ???p?? ?e?t?????a?
  • ? a?a??t?s? e??a? ?d?a ?p?? ?a? se ??a ap??
    d?ad??? d??d?? a?a??t?s??.
  • ?et? ap? ???e e?sa???? ?a? d?a??af? p??pe? ?a
    ???e? ??e???? ??a t? a? ??a??p??e?ta? ?
    pe?????sµ?? t?? AVL (d?af??? t?? ???? t??
    ?p?d??d???).

14
???d?a AVL
  • Se pe??pt?s? p?? de? ?p???e? p??ß??µa st? d?µ?
    t?? d??d???, t?te de? apa?te?ta? ?aµ?a ????
    e????e?a.
  • ??af??et??? ?a p??pe? ?a ?????? d?µ???? a??a???
    st? d??d?? ?ste ?a p?????e? p??? ??a d??d?? AVL.

15
?e??st??f??
  • ????µe d?? e?d? pe??st??f??
  • ?p?? pe??st??f?
  • ?e??st??f??ta? d?? ??µß??
  • ??p?? pe??st??f?
  • ?e??st??f??ta? t?e?? ??µß??
  • ???ta ?a d??µe t? e??a? a?t?? ?? pe??st??f?? ?a?
    st? s????e?a ?a e?et?s??µe t? ???s? t???

16
?p?? ?e??st??f?
?e??pt?s? 1
17
?p?? ?e??st??f?
?e??pt?s? 2
18
?p?? ?e??st??f? - ?a??de??µa
h
h1
??t? e??a? ??a d??d?? AVL
19
?p?? ?e??st??f? - ?a??de??µa
h
h2
??sa???? 02
?et? t?? e?sa???? t?? ??µß?? 2 t? d??d?? p??
p????pte? ??? e??a? AVL
20
?p?? ?e??st??f? - ?a??de??µa
x
y
h
h
h1
C
B
A
21
?et? t?? ?e??st??f?
y
x
A
B
C
22
?p?? ?e??st??f?
  • ?e????? f???? t? p??ß??µa se ???eta? µe ap??
    pe??st??f?

k2
k1
k1
Z
k2
h
X
h2
X
Y
h
h2
Y
Z
?? µp????µe ?a ?????µe ??p?? pe??st??f? !
23
??p?? ?e??st??f?
?e??pt?s? 3
24
??p?? ?e??st??f?
?e??pt?s? 4
25
??p?? ?e??st??f? - ?a??de??µa
??t? e??a? ??a d??d?? AVL
h
h1
??a??af? t?? ??µß?? 94
26
??p?? ?e??st??f? - ?a??de??µa
h2
h
?a?aß???eta? ? ???sµ?? t?? AVL
27
??p?? ?e??st??f? - ?a??de??µa
x
y
z
C
A
B1
B2
28
?et? t? ??p?? ?e??st??f?
z
x
y
A
B1
B2
C
29
???d?a ?????? ???µ??
Page 166
???d?? 5 d??µ??
30
?a??de??µa
???d?? 5 d??µ?? 31 ??µß?? 3 ep?peda
??ad??? d??d?? 31 ??µß?? 5 ep?peda
Write a Comment
User Comments (0)
About PowerShow.com