
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Information about a university homework assignment from wentworth institute of technology's division of professional and continuing studies, in which students are required to write and compare sorting routines using different algorithms. The assignment includes details about the due date, instructor contact information, and instructions on how to implement and test the sorts, as well as creating graphs of the running times.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!
COMP385 Section 71 - Data Structures II - Fall, 2005
Instructor: Bob Goldstein (617) 912- bobg@vision.eri.harvard.edu http://webpages.charter.net/tlgcreations/Courses/index.html http://goldstein.eri.harvard.edu/courses/index.html http://public.wit.edu/~goldsteinr/index.html Due Date: September 27, 2005 Hand In: Printout of program code and dialogue of how it runs. GRAPH of running times Purpose: This homework is intended to write a sorting routine in a generic manner and compare sort algorithms. Compare three sorts: (1) home-grown bubble sort (2) home grown quicksort and (3) built-in Java Arrays sort facility Description: This homework is a modification of either Ford and Topp’s program 7.1 or the SortComparisons example we did in class. After you implement the program, you need to run it several times to get the running times for arrays of length 10,100,1000, 10000, and 100000 and GRAPH THE RESULTS. The objects to be sorted are the “ListItem” objects from the QuickSort example we did in class. Here are the things you need to do to accomplish this homework: (1) Re-write a bubble sort in a generic form so that it can be used to sort arrays of any object that implements “comparable” (2) Re-write the quicksort method we did in class so that it also can sort generic objects (3) Modify the SortComparison program so that it invokes these new sorts. You need to modify the part of the program that populates the arrays so that it populates them with random ListItems rather than integers. (4) Make a graph of the results (you can use a log-linear graph). You can use Excel to make the graphs. Hand in your code as well as a graph of the running times of these three sorts as a function of length of the input arrays. Extra Credit: Have the program keep track of the number of comparisons, and graph these as well as the time. /app/work/qkd8hl-355989-2765047-homework3-doc.doc 1 12/6/2020 12/6/