CSC 172
Homework assignment 4

Assigned 16 Mar, 1999
Due 8 Apr, 1999

Searching and Sorting with Different Data Structures

I assume you've completed homework 3. In this assignment, you'll modify that program to use different data structures instead of the Vector used there.

HW 4a: Arrays

Modify your program from homework 3 to store all the names in an array, rather than a Vector. In Java, you have to know how big an array will be before you can create it, so for purposes of this assignment, you may assume that there will never be more than 20 names. If you've designed homework 3 well, you should be able to do this without modifying your Name class or your main program at all, only your NameList class.

HW 4b: Linked Lists

Modify your program from homework 3 to store all the names in a linked list, rather than a Vector. Linked lists make insertion and deletion very efficient, but binary search becomes difficult, so you don't need to implement binary search for this version of the program.


Last modified: Tue Mar 16 09:58:48 EST 1999
Stephen Bloch / sbloch@adelphi.edu