scroll to top
Stuck on your essay?
Get ideas from this essay and see how your work stacks up
Word Count: 1,170
For this lab I tested ten different sorting methods by comparing the time it took to sort ordered reverse ordered and random ordered arrays of Integer objects of different sizes I had to write a Timer class that started the timer before the sorting method was called and stopped the timer when the method was finished sorting the array The elapsed time was calculated by another method in the Timer class so that the actual run time could be printed once the method completed My test program contained methods to run all of the sorting methods given the size type of array ordered reverse or random and the number times to run the sorting method all entered by the user before the timer was stopped For my timing experiment I carried out tests on an array of size 1000 run 100 times through the method before printing the time since it would be relatively fast for one iteration an array of size 10000 run 10 times an array of size 25000 run 1 time and an array of 50000 run 1 time For the arrays of 1000 10000 and 25000 I did five trials for ordered reverse and random arrays to get a good average of the time it took since each run varied slightly Since the array of 50000 took a long time to run I conducted only two trials for each size on the three different types of arrays and found the average The run times are included at the end of this report I then calculated the time it would take to do one iteration through each of the different sizes for the different types of arrays ie I divided the average time it took to run the ordered array of 1000 100 times by 100 to get the average time it would take to run it once This data is also available at the end of this report The outcome
@Kibin is a lifesaver for my essay right now!!
- Sandra Slivka, student @ UC Berkeley
Wow, this is the best essay help I've ever received!
- Camvu Pham, student @ U of M
If I'd known about @Kibin in college, I would have gotten much more sleep
- Jen Soust, alumni @ UCLA