Repeat Project, but define a class of sets instead. Recall from Project in Chapter 1 that a set is a bag whose entries are distinct.
Define a class of bags by using an instance of the class AList to contain its entries. Then write a program that adequately demonstrates your new class.
As we mentioned in Segment 1.21, a set is a special bag that does not allow duplicates.
a. Specify each operation for a set of objects by stating its purpose; by describing its parameters; and by writing preconditions, postconditions, and a pseudocode version of its header. Then write a Java interface, SetInterface
, for the set. Include javadoc-style comments in your code. b. Suppose the class Set
implements SetInterface . Given an empty set that is an object of Set and an object of the class Bag that contains several strings, write statements at the client level that create a set from the given bag.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.