CSC263H1 Lecture 12: Lecture 12.docx

33 views1 pages
School
Course

Document Summary

Cost of find(z) = o(length of findpath z root) L: with wu(by size) any tree t of height h created during the execution of has at least 2^h nodes. Proof: by induction on h: h = 0. Any tree t of height h = 0 has at least 2^0 = 1 node (*: suppose (*) holds for h [i. h] We show (*) holds for h + 1. Consider the moment a tree t of height h + 1 is created during the execution of . T was created by attaching a tree a of height h. to tree b: by i. h. , |a| 2^h, by wu |b| |a| 2^h. |t| = |a| + |b} 2^h + 2^h = 2^(h+1) => wu rule: wc cost of is o(n(unions) + m*logn(finds))

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents