23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

To compare the growth rates of different functions, it is sometimes helpful to apply<br />

the follow<strong>in</strong>g rule.<br />

Proposition A.24 (L'Hôpital's Rule): If we have limn→∞f(n) = +∞ <strong>and</strong> we have<br />

limn→∞g(n) = +∞, then limn→∞f(n)/g(n) = lim n→∞ f′(n)/g′(n), where f′(n) <strong>and</strong> g′(n)<br />

respectively denote the derivatives of f(n) <strong>and</strong> g (n).<br />

In deriv<strong>in</strong>g an upper or lower bound for a summation, it is often useful to split a<br />

summation as follows:<br />

.<br />

Another useful technique is to bound a sum by an <strong>in</strong>tegral. If f is a nonde-creas<strong>in</strong>g<br />

function, then, assum<strong>in</strong>g the follow<strong>in</strong>g terms are def<strong>in</strong>ed,<br />

There is a general form of recurrence relation that arises <strong>in</strong> the analysis of divide-<strong>and</strong>conquer<br />

algorithms:<br />

T(n) = aT(n/b) + f(n),<br />

for constants a ≥ 1 <strong>and</strong> b>1.<br />

Proposition A.25: Let T(n) be def<strong>in</strong>ed as above. Then<br />

1. If f(n) is O(n log b a −ε , for some constant > 0, then T(n) is Θ(n log b a ).<br />

2. If f(n) is Θ(n log b a log k n), for a fixed nonnegative <strong>in</strong>teger k≥ 0, then T(n) is<br />

Θ(n log b a log k+1 n).<br />

3. If f(n) is Ω(n log b a+ ), for some constant > 0, <strong>and</strong> if a f (n/b) ≤ cf(n), then<br />

T(n) isΘ(f(n)).<br />

This proposition is known as the master method for characteriz<strong>in</strong>g divide-<strong>and</strong>conquer<br />

recurrence relations asymptotically.<br />

.<br />

918

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

Saved successfully!

Ooh no, something went wrong!