18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Exercises<br />

positions, while has been shifted k=4 positions.<br />

❍ Suppose you know what k is. Give an O(1) algorithm to find the largest number in A.<br />

❍ Suppose you do not know what k is. Give an algorithm to find the largest number in<br />

A. For partial credit, you may give an O(n) algorithm.<br />

12. (*) Suppose that you are given a sorted sequence of distinct integers . Give an<br />

algorithm to determine whether there exists an index i such at . For example, in<br />

, . In , there is no such i.<br />

Next: Implementation Challenges Up: Breaking Problems Down Previous: Square and Other Roots<br />

<strong>Algorithm</strong>s<br />

Mon Jun 2 23:33:50 EDT 1997<br />

file:///E|/BOOK/BOOK2/NODE57.HTM (4 of 4) [19/1/2003 1:29:01]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!