lab6 - COP 3502 Lab Notes Continuation of Order Analysis...

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

View Full Document Right Arrow Icon
COP 3502 – Lab Notes Continuation of Order Analysis Last week’s lab introduced you to the concept of order analysis. This week we will use this information to estimate the running time of algorithms based on their order. Estimating Run-Time We know that we can't accurately compare run times measured on different machines, or with different operating systems or languages or compilers. But, what if we have measured the run time of a specific algorithm, on a specific combination of hardware, OS, language and compiler? How do we estimate the new run time just for a change in data size? If the algorithm is linear, i.e., O(n), it should be easy. If we know the ratio of old data size to new data size, we know the increase or decrease in time. For example: if it took 10 seconds for n = 50, then if we double the data size to n = 100, it should take twice as long. Since increases in data size are not always going to be by integer multipliers, we should generalize this calculation to a simple formula that can be used for any values: time new n new time old n old = This formula is based on the fact that the ratio of data size (n) over time is the same for both the old and new data sizes, i.e., the time to perform each step is the same. The increase or decrease in time comes from the change in the size of the data, which
Background image of page 1

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

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

Page1 / 4

lab6 - COP 3502 Lab Notes Continuation of Order Analysis...

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

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