This preview shows page 1. Sign up to view the full content.
Unformatted text preview: operations. For example, we could compare x to y and swap them if x &lt; y in constant time. Can we implement a data structure over this data type such that INSERT and EXTRACT-MAX both run in o (log n ) time? If so, provide main ideas behind the implementation. If not, prove it is impossible. Problem 3-5. 20pts CLRS 11-1, page 282 (page 249 in 2nd edition). Problem 3-6. 20pts CLRS 11-2, page 283 (page 250 in 2nd edition). Problem 3-7. Extra credit : Direct approach to nding the second smallest element in an array is to rst nd the minimum, delete it, and then nd the minimum in the remaining set. This results in (2 n constant ) comparisons. Show that we can do this using only n + O (log n ) comparisons in the worst case. More precisely, show that n + log 2 n 2 comparisons are sucient. 1...
View Full Document
- Spring '09