

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Written 3 Page 1
CS 2420 Summer 2008 Written 5 – 10 Points Due July 14, 2008 Sort Detective Written homework provides an excellent framework for achieving the goals of obtaining a working knowledge of data structures, perfecting programming skills, and developing critical thinking strategies to aid the design and evaluation of algorithms. Since programming has a high overhead in terms of program entry and debugging, all important topics in this course cannot be covered via programming projects. Written homework exercises allow students to learn important material without a high time investment. Although the point value is low, the benefits are great. You can perfect your programming skills without spending hours at the computer and can get feedback on your thinking skills from your study partners. Students that consistently do quality homework, have far superior test scores. Because assignments are done as a group and any questions are discussed in class or during office hours, written solutions to the homework will not be provided.
Note, these exercises may be done in groups of one, two, or three. If more than one person is involved, list all the names on one set of answers. Turn in only one copy of the assignment for all group members. Groups may change throughout the semester. Answers should not be compared with others not in your group. You will learn much more by working in a group than you will learn working by yourself.
The primary objective of this assignment is for you to apply your theoretical knowledge of sorting algorithms to solve a problem of poor user interface design. More specifically, you will be given a program which is designed to measure comparisons and data movements for six sorting algorithms discussed in class. Unfortunately, the designer of the program did not label the buttons properly. You must apply your understanding of the general properties of the algorithms (and in some cases of the code used to implement them) to determine the proper labeling of the buttons.
The secondary objective of this lab is for you to gain experience writing a concise, but complete analysis of a system.
As you know from class, if you double the size of the data set that you give to a quadratic algorithm, it does four times the work; by contrast, an Ο( n log n )algorithm does a bit more than
twice as much; and a linear algorithm does only twice as much work. As you also know, the characteristics of the input data set can affect the expected performance of many of our sorting algorithms. Before you begin the lab, you should review the expected performance of the algorithms on various data sets.
The sorting algorithms under study include HeapSort, MergeSort, QuickSort, SelectionSort, ShellSort, and “other”.
Written 3 Page 2
there is an ‘Non‐Random’ button that generates a list that is not random. The “reverse order input” creates data that is almost reversed of what you want. Important characteristics of sorts include: stability, oblivious, run time, and amount of data moved.
There is no coding in this lab. Thus, you should expect that a significant portion of the grade for this assignment will be determined by the quality of the writing of the report. This includes the completeness of the report, the clarity (and grammar) of the writing, and general presentation.
Some of the sorts are very difficult to distinguish. A carefully outlined experiment may compensate for an error in these cases if the writing makes it clear that your conclusions/guesses are substantiated by the data.
Finally, remember that your report needn’t detail every experiment you ran. Rather, it should give sufficient information to justify your conclusions. It is possible to write a very short report that is completely correct if your experiments are well-chosen. After you learn the matching, you might consider whether there was a shorter way to arrive at your conclusion!
Be aware that the work is counted loosely – so while counts within the same sort are comparable, work counts between sorts are not.