Extend Array List - Homework Seven | 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/19/2009

koofers-user-pwo
koofers-user-pwo 🇺🇸

3

(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
COMP380 Section 71 - Data Structures I - Spring, 2007
Homework 7 – ExtendArrayList
Instructor: Bob Goldstein (617) 912-2512
http://home.comcast.net/~goldsteinr/Courses/index.html
http://goldstein.eri.harvard.edu/courses/index.html
http://myweb.wit.edu/goldsteinr/Courses/index.html
Due Date: March 27, 2007
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/qkd851-459789-2765035-homework7-doc.doc 1 12/5/2020 12/5/2020

Partial preview of the text

Download Extend Array List - Homework Seven | 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 7 – ExtendArrayList

Instructor: Bob Goldstein (617) 912- [email protected] http://home.comcast.net/~goldsteinr/Courses/index.html http://goldstein.eri.harvard.edu/courses/index.html http://myweb.wit.edu/goldsteinr/Courses/index.html Due Date: March 27, 2007 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/qkd851-459789-2765035-homework7-doc.doc 1 12/5/2020 12/5/