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

Create successful ePaper yourself

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

Runn<strong>in</strong>g<br />

Maximum Problem Size (n)<br />

Time (μs)<br />

1 second<br />

1 m<strong>in</strong>ute<br />

1 hour<br />

400n<br />

2,500<br />

150,000<br />

9,000,000<br />

2n 2<br />

707<br />

5,477<br />

42,426<br />

2 n<br />

19<br />

25<br />

31<br />

The importance of good algorithm design goes beyond just what can be solved<br />

effectively on a given computer, however. As shown <strong>in</strong> Table 4.4, even if we<br />

achieve a dramatic speed-up <strong>in</strong> hardware, we still cannot overcome the h<strong>and</strong>icap of<br />

an asymptotically slow algorithm. This table shows the new maximum problem size<br />

achievable for any fixed amount of time, assum<strong>in</strong>g algorithms with the given<br />

runn<strong>in</strong>g times are now run on a computer 256 times faster than the previous one.<br />

Table 4.4: Increase <strong>in</strong> the maximum size of a problem<br />

that can be solved <strong>in</strong> a fixed amount of time, by us<strong>in</strong>g a<br />

computer that is 256 times faster than the previous one.<br />

237

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

Saved successfully!

Ooh no, something went wrong!