CMPSCI 187: Programming With Data Structures

David Mix Barrington

Fall, 2012

Solution to Programming Project #1

Project #1 was to create a class called StringBag.java, whose objects are collections of String objects and whose principle methods are to insert a new object, remove an object from a particular place in the sequence, and to remove a randomly chosen object.

This class, written by Tom Billings and edited by David Mix Barrington, meets the requested specification and also includes one more method used in Discusson #3. This method loads a text file into a StringBag object, treating each line of the text file as a separate string.

Last modified 26 September 2012