napredni vidovi drva

Download Napredni vidovi drva

Post on 24-Jul-2015

1.609 views

Category:

Documents

4 download

Embed Size (px)

TRANSCRIPT

  • AVL B Red/Black

    BST, AVL, B, Red/Black

    e

    18.12.2007 /

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    j .

  • AVL B Red/Black

    def. n , d n 1 2d j j n .

  • AVL B Red/Black

  • AVL B Red/Black

    def. j j .

  • AVL B Red/Black

    1

  • AVL B Red/Black

    2

  • AVL B Red/Black

    def. 1.

  • AVL B Red/Black

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    j

    j j , inorder .

    j- j- j

    j j- / j- / j

  • AVL B Red/Black

    1 ..

  • AVL B Red/Black

    http://bach.taneski.com/applet/rot/

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    AVL

    j ( ).

    . . 1962

  • AVL B Red/Black

    :

    (log n)

  • AVL B Red/Black

    j j j {1, 0, 1}.def. AVL .

  • AVL B Red/Black

    AVL

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    j j

    j j 2 2

  • AVL B Red/Black

    2 ( ) j 2 ( ) j

  • AVL B Red/Black

    .

    j BST j

    j j 2 2

  • AVL B Red/Black

    j BST.

  • AVL B Red/Black

    http://bach.taneski.com/applet/

    AVL :( j )

    8, 9, 13, 3, 4, 2, 10, 14, 12, 11, 7, 6, 5, 15, 1

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    B

    AVL Red/Black .

    Rudolf Bayer Ed McCreight 1972

  • AVL B Red/Black

    B j

    def.B m > 1 : j j dm2 e m 2 j ( ) j k k 1

  • AVL B Red/Black

    B

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    . j , (j )

    j :- j j

    - j , .

    - j , .

  • AVL B Red/Black

    j , .

    j j.

  • AVL B Red/Black

    j BST .

  • AVL B Red/Black

    http://bach.taneski.com/applet/

    B :( j )

    8, 9, 13, 3, 4, 2, 10, 14, 12, 11, 7, 6, 5, 15, 1

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    Red/Black

    B

    Rudolph Bayer 1972

    , (log n)

  • AVL B Red/Black

    Red/Black j

    def./ .j j j j , . : j j j. j. j (j nil) j . j j j j j j.

  • AVL B Red/Black

    Red/Black Red/Black

    j R/B :

    j j j .

  • AVL B Red/Black

    Red/Black

  • AVL B Red/Black

    1

    2 AVL j AVL

    3 B B

    4 Red/Black /

  • AVL B Red/Black

    /

    . j 5 6

    j BSD .

    .

  • AVL B Red/Black

    /

    j j j.

  • AVL B Red/Black

    http://bach.taneski.com/applet/

    / :( j )

    8, 9, 13, 3, 4, 2, 10, 14, 12, 11, 7, 6, 5, 15, 1

  • AVL B Red/Black

    //

    .

  • AVL B Red/Black

    j?

    .

  • AVL B Red/Black

    j?

    .

    AVL AVL

    B- B-

    Red/Black /