Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Sorting Algorithms Comparison at Wentworth Institute of Technology - Fall 2005, Assignments of Data Structures and Algorithms

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

Pre 2010

Uploaded on 08/16/2009

koofers-user-vl9
koofers-user-vl9 🇺🇸

4

(1)

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Wentworth Institute of Technology
Division of Professional and Continuing Studies
COMP385 Section 71 - Data Structures II - Fall, 2005
Homework 3 – Sorting Times
Instructor: Bob Goldstein (617) 912-2512
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/2020

Partial preview of the text

Download Sorting Algorithms Comparison at Wentworth Institute of Technology - Fall 2005 and more Assignments Data Structures and Algorithms in PDF only on Docsity!

Wentworth Institute of Technology

Division of Professional and Continuing Studies

COMP385 Section 71 - Data Structures II - Fall, 2005

Homework 3 – Sorting Times

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/