Analysis of Algorithms

advertisement
Analysis of Algorithms
Assignment #1
Date Due: Two weeks from the date of assignment.
Assemble a program that implements the following sorting algorithms: bubble sort,
insertion sort, selection sort, merge sort, heap sort and quick sort. For each possible array
length 2i * 500, where 0<=i<=15 (approximately), your program should execute each of
the sorting algorithms on 100 randomly generated arrays of integers. Your program
should then calculate the average running time on those integers (or the average number
of instructions or "compares"). Using MS Excel (or similar) you should then graph the
average asymptotic running time for each algorithm (and array length).
Project Deliverables:
In hardcopy:
 One graph displaying the measured average asymptotic running times for all
algorithms.
 A graph showing the "crossover point" for two algorithms that have a different
theoretical asymptotic running time, e.g., merge sort and bubble sort.
 A printout of the source code of your program.
In softcopy:
 A copy of the source code of your program emailed to: pbernhar@cs.fit.edu
Download