{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Prog02 - You see I didn’t use the computer clock I used...

Info icon This 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.
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 didn’t use the computer clock. I used my own office clock and the ol’ 1-Mississippi, 2-Mississippi method. The results weren’t 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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern