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 EXTRACTMAX both run in o (log n ) time? If so, provide main ideas behind the implementation. If not, prove it is impossible. Problem 35. 20pts CLRS 111, page 282 (page 249 in 2nd edition). Problem 36. 20pts CLRS 112, page 283 (page 250 in 2nd edition). Problem 37. 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
 R
 Probability

Click to edit the document details