CSci 2101 Problem set 5:

Due Friday, March 24th at 11:59pm (by e-mail)

38 points

Problem 1 (8 points): equals method for OurLinkedList

Implement a method equals in OurLinkedList class that takes an object and returns true if that object is an instance of OurLinkedList and has the exact same elements (as given by calling equals method on the respective elements) in the same order and false otherwise. If two lists are of different size, the method returns false. You may assume that your list does not contain null elements.

You can use your own OurLinkedList implementation, or just the starting code here since you only need an add method to test equals.

Test your method well and submit all of your testing code.

Problem 2 (30 points): implementing a Set class

This problem is loosely based on Problem 14 on p. 239 and asks you to implement and test a class Set<E>. A set should work according to the mathematical definition of a set. A few requirements and details:

How to submit

Submit your Java file(s) to me by e-mail. The subject must be Problem Set N, where N is the problem set number. If working in a group, CC your group partner.


CSci 2101 course web site.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.