lec1020-AVL-annb - Announcements: MPSavaila Ie. Due 10/29....

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Announcements: MPSavaila Ie. Due 10/29. 11:59p. EC due 10/22.11/59p. . Em). “ 2. 749 ram-M “M; annex—s um). Today: +0 agar; W Balanced BST— Weiss, 4.4 http://www.qmatica .com/DataStructures/Trees/BSThtmI Warm-ups: 1. Fill in the blanks to give the recursive definition of 8 BST: A binary tree T is a binary search tree (BST) if: - T is empty. or oTis{;p.I‘_._T‘}and x TL -) key(x) i key(r). x E TR 9 key(x) 4 key(r). and W 2. Correct the following specification for ADT dictionary: insert(ke data) traverseo -> afind rerpove(&-> void ’ du‘lk 3. T F BSTs have better worst-case performance than SLL J 4. How much would you pay for a BST ‘find' whose running time is 9(log n)? S, 'A’ N . 5. What data structure is used to support a level ordgr'daversa o a binary tree? ) $9 (ML something new... which tree makes you happiest? -Hrz skorttfwa «oh .3 gym '32:, \ e a» The “height balancebof a tree 1' is: g = he_ight(T,) - heigbt(TR) A tree T is “height bala_gced" if: «"1": I NTt;T¢u&h (ti-LO. \m ww 9mm ubmd’m m U: 0003.0 Binary Search Tree - is this tree “height balanced”? ea» 4-“. m 4; u a W3 «.4. wangfvpficuhm 0% Qofi ovJ-w “was / a chm *H “14% “L M, W (Xv/Nd”? WOLDMWSWQ’YIMZGJ stm M 4m Mam balanced trees - rotations thither h” M mt balanced trees - rotations balanced trees - rotations balanced trees - rotations summary: 1. there are 4 kinds: left. right. left-right. right-left (symmetric!) local operations (subtrees not affected) 2. 3. constant time operations 4. BST characteristic maintained height balanced trees - we have a special name: Three issues to consider as we move toward implementation: Rotating Maintaining height Detecting imbalance ...
View Full Document

Page1 / 9

lec1020-AVL-annb - Announcements: MPSavaila Ie. Due 10/29....

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online