COT5407-Class02

COT5407-Class02 - RunningTime 2004Goodrich,Tamassia 1...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
© 2004 Goodrich, Tamassia 1 Running Time
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2004 Goodrich, Tamassia 2 Experimental Studies Write a program  implementing the algorithm Run the program with  inputs of varying size and  composition Use a method like  System.currentTimeMillis( )  to get an accurate  measure of the actual  running time Plot the results 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 0 50 100 I nput Size Time (ms)
Background image of page 2
© 2004 Goodrich, Tamassia 3 Limitations of Experiments It is necessary to implement the  algorithm, which may be difficult Results may not be indicative of the  running time on other inputs not included  in the experiment.  In order to compare two algorithms, the  same hardware and software  environments must be used
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© 2004 Goodrich, Tamassia 4 Theoretical Analysis Uses a high-level description of the  algorithm instead of an implementation Characterizes running time as a  function of the input size,  n . Takes into account all possible inputs Allows us to evaluate the speed of an  algorithm independent of the hardware/ software environment
Background image of page 4
10/10/09 5 Pseudocode High-level description  of an algorithm More structured than  English prose Less detailed than a  program Preferred notation for  describing algorithms Hides program design  issues Algorithm arrayMax ( A , n ) Input array A of n integers Output maximum element of A currentMax A [0] for i 1 to n - 1 do if A [ i ] currentMax
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/03/2011 for the course COT 5407 taught by Professor Staff during the Fall '08 term at FIU.

Page1 / 15

COT5407-Class02 - RunningTime 2004Goodrich,Tamassia 1...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online