Prog02 - You see, I didnt use the computer clock. I used my...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 375 Program 2 George Corser 2009 March 2 Program 2 Asymptotic Analysis My implementation of Program 2 is Θ(n). For every input, i.e. for every currency amount read into the program, the program loops through the linked list of currency denominations exactly once. This indicates a linear relationship between inputs and run time. While I did not test it as thoroughly as Program 1, I did run Program 2 against the Program 1 data. Specifically, I used the integer inputs, p1-10000.txt (10,000 integers) through p1-50000.txt (50,000 integers). The file p1-50000.txt was the largest input file I had conveniently available. Smaller files led to inconclusive results because they were hard to time.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: You see, I didnt use the computer clock. I used my own office clock and the ol 1-Mississippi, 2-Mississippi method. The results werent precise, but they did tend to support that the program runs in (n) time. 50 time (seconds) inputs (number of integers) Program 2 Run Times Time 9 19 30 41 49 10000 20000 30000 40000 50000 As the chart above indicates, the time to run Program 2 was roughly proportional to the number of inputs. It was almost exactly a linear relationship between inputs and run time....
View Full Document

This note was uploaded on 01/19/2010 for the course CSC 375 taught by Professor Turner during the Spring '09 term at University of Michigan-Dearborn.

Ask a homework question - tutors are online