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.

Logarithms<br />

justified in ignoring the base of the logarithm when analyzing algorithms.<br />

When performing binary search in a telephone book, how important is it that each query split the<br />

book exactly in half? Not much. Suppose we did such a sloppy job of picking our queries such<br />

that each time we split the book 1/3 to 2/3 instead of 1/2 to 1/2. For the Manhattan telephone<br />

book, we now use queries in the worst case, not a significant change from<br />

. <strong>The</strong> power of binary search comes from its logarithmic complexity, not the<br />

base of the log.<br />

● Logarithms cut any function down to size: <strong>The</strong> growth rate of the logarithm of any polynomial<br />

function is . This follows because<br />

<strong>The</strong> power of binary search on a wide range of problems is a consequence of this observation. For<br />

example, note that doing a binary search on a sorted array of things requires only twice as many<br />

comparisons as a binary search on n things. Logarithms efficiently cut any function down to size.<br />

Next: Modeling the Problem Up: Introduction to <strong>Algorithm</strong>s Previous: Growth Rates<br />

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

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

file:///E|/BOOK/BOOK/NODE16.HTM (3 of 3) [19/1/2003 1:28:14]

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

Saved successfully!

Ooh no, something went wrong!