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 Seven: ExtendArrayList - Data Structures I | 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 2006;

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-jln
koofers-user-jln 🇺🇸

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, 2006
Homework 7 – ExtendArrayList
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 23, 2006
Hand In: Printout of program code and dialogue of how it runs.
Purpose: Practice using and extending the ArrayList Data Structure
1. Write a program similar to the ExtendArrayList program we did in class. Extend the ArrayList
class and call your new class ArrayListPlus.
2. Add the following functionality to the ArrayList class:
a. void reverseList() – reverses the items in the list .
b. boolean unique(T item) – returns true if there is one occurrence of item in the list. Returns
false if there are zero or more than one occurrences
3. Test your program with a class of your choice: (Strings, Clothings, SSNs, PlayingCards)
Extra Credit:
Add the functionality
removeDuplicates( T item)
that removes all duplicates of the item in the list.
/app/work/qkdbqu-476801-2765022-homework7-doc.doc 1 12/4/2020 12/4/2020

Partial preview of the text

Download Homework Seven: ExtendArrayList - Data Structures I | 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, 2006

Homework 7 – ExtendArrayList

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 23, 2006 Hand In: Printout of program code and dialogue of how it runs. Purpose: Practice using and extending the ArrayList Data Structure

  1. Write a program similar to the ExtendArrayList program we did in class. Extend the ArrayList class and call your new class ArrayListPlus.
  2. Add the following functionality to the ArrayList class: a. void reverseList() – reverses the items in the list. b. boolean unique(T item) – returns true if there is one occurrence of item in the list. Returns false if there are zero or more than one occurrences
  3. Test your program with a class of your choice: (Strings, Clothings, SSNs, PlayingCards) Extra Credit: Add the functionality removeDuplicates( T item) that removes all duplicates of the item in the list. /app/work/qkdbqu-476801-2765022-homework7-doc.doc 1 12/4/2020 12/4/