next up previous
Next: About this document

9.2-3, 10.3-1, 10.3-3, 10.3-7, 10.3-8 and

Describe an algorithm that, given n integers in the range 1 to k, preprocesses its input and then answers any query about which is the tex2html_wrap_inline14 smallest number in O(1) time. Your algorithm should use O(n+k) preprocessing time. (Hint: This problem is similar to the problem 9.2-5, which you did in the last homework.)





Kamal Jain
Fri Jul 24 15:26:16 EDT 1998