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.

<strong>and</strong> y-coord<strong>in</strong>ate equal to the runn<strong>in</strong>g time, t. (See Figure 4.3.) From this<br />

visualization <strong>and</strong> the data that supports it, we can perform a statistical analysis that<br />

seeks to fit the best function of the <strong>in</strong>put size to the experimental data. To be<br />

mean<strong>in</strong>gful, this analysis requires that we choose good sample <strong>in</strong>puts <strong>and</strong> test<br />

enough of them to be able to make sound statistical claims about the algorithm's<br />

runn<strong>in</strong>g time.<br />

Figure 4.3: Results of an experimental study on the<br />

runn<strong>in</strong>g time of an algorithm. A dot with coord<strong>in</strong>ates (n,<br />

t) <strong>in</strong>dicates that on an <strong>in</strong>put of size n, the runn<strong>in</strong>g time<br />

of the algorithm is t milliseconds (ms).<br />

While experimental studies of runn<strong>in</strong>g times are useful, they have three major<br />

limitations:<br />

• Experiments can be done only on a limited set of test <strong>in</strong>puts; hence, they<br />

leave out the runn<strong>in</strong>g times of <strong>in</strong>puts not <strong>in</strong>cluded <strong>in</strong> the experiment (<strong>and</strong> these<br />

<strong>in</strong>puts may be important).<br />

225

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

Saved successfully!

Ooh no, something went wrong!