$30
Goals • to implement a few sorting algorithms and to understand their performance.
Requirements
and Notes • Download the the text @ile magicitems.txt from our web site.
• Read it line by line into an array.
• Develop your own implementation of selection sort, insertion sort,
merge sort, and quick sort.
• Sort using your selection sort. Print the number of comparisons.
• Sort using your insertion sort. Print the number of comparisons.
• Sort using your merge sort. Print the number of comparisons.
• Sort using your quick sort. Print the number of comparisons.
• Record your results in a table in your LaTeX document. Also note the
asymptotic running time of each sort and explain why it is that way.
[10 points]
[10 points]
[30 points]
[30 points]
[20 points]
Your code must …
• separate structure from presentation.
• be professionally formatted yet uniquely yours (show some personality)
• use and demonstrate best practices.
• make me proud to be your teacher.
[−∞ if not]
Resources • Insertion sort, merge sort, and quick sort are described in our text in sections 2.1, 2.3,
and 7.1 respectively.