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

Homework Six for Binary Search | COMP 380, Assignments of Data Structures and Algorithms

Material Type: Assignment; Class: DATA STRUCTURES I; Subject: Computer Science; University: Wentworth Institute of Technology; Term: Spring 2007;

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-0q2
koofers-user-0q2 🇺🇸

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
COMP380 Section 71 - Data Structures I - Spring, 2007
Homework 6 – Binary Search
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://myweb.wit.edu/goldsteinr/Courses/index.html
Due Date: March 6, 2007
Hand In: Printout of program code and dialogue of how it runs.
Purpose:
Purpose: Binary Search
1. Modify the recursive versions of the binary search program that we did in class so that it works
with objects that implement the Comparable interface.
2. If you have not already done so, add the compareTo method of your “Clothing” class that you did
for a prior homework and have it implement “Comparable”
3. Make a large random array of “Clothings” and test your version of the binary search program on
it.
4. Time the operation of multiple binary searches using the Timing class.
Extra Credit:
Modify the Iterative version of the binary search program and time it and compare it to the
recursive one.
/app/work/qkd51k-445402-2765034-homework6-doc.doc 1 11/30/2020 11/30/2020

Partial preview of the text

Download Homework Six for Binary Search | COMP 380 and more Assignments Data Structures and Algorithms in PDF only on Docsity!

Wentworth Institute of Technology

Division of Professional and Continuing Studies

COMP380 Section 71 - Data Structures I - Spring, 2007

Homework 6 – Binary Search

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://myweb.wit.edu/goldsteinr/Courses/index.html Due Date: March 6, 2007 Hand In: Printout of program code and dialogue of how it runs. Purpose: Purpose: Binary Search

  1. Modify the recursive versions of the binary search program that we did in class so that it works with objects that implement the Comparable interface.
  2. If you have not already done so, add the compareTo method of your “Clothing” class that you did for a prior homework and have it implement “Comparable”
  3. Make a large random array of “Clothings” and test your version of the binary search program on it.
  4. Time the operation of multiple binary searches using the Timing class. Extra Credit: Modify the Iterative version of the binary search program and time it and compare it to the recursive one. /app/work/qkd51k-445402-2765034-homework6-doc.doc 1 11/30/2020 11/30/