Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

* Creates a new set that combines the contents of this set and * a second given set without affecting the original two sets. *

 * Creates a new set that combines the contents of this set and * a second given set without affecting the original two sets. * * @param otherSet the given set * @return a setOfEntries that is the union of the two sets */ public ArraySetWithArray union(ArraySetWithArray otherSet) { // TODO Project 2 return null; // THIS IS A STUB } // end union /** * Creates a new set that contains those objects that occur in both this * set and otherSet without affecting the original two sets. * * @param otherSet the given set * @return a set that is the intersection of the two sets */ public ArraySetWithArray intersection(ArraySetWithArray otherSet) { // TODO Project 2 // one return statement per method please // do NOT call contains, utilize getIndexOf(anEntry) instead return null; // THIS IS A STUB } // end intersection /** * Creates a new set of objects that would be left in this set * after removing those that also occur in a second given set * without affecting the original two sets. * * @param otherSet the given set * @return a set that is the difference of the two sets */ public ArraySetWithArray difference(ArraySetWithArray otherSet) { // TODO Project 2 // one return statement per method please // do NOT call contains, removeEntry(givenIndex) methods instead return null; // THIS IS A STUB } // end difference /** * Creates a new set of objects that are in this set and are less than a given object. * * @param anEntry a given object * @return a new set of objects that are in this set and are less than anObject */ public ArraySetWithArray getAllLessThan(T anEntry) { // TODO Project 2 // one return statement per method please // for (int i = 0; i < a.length; i++) { // utilize compareTo method return null; // THIS IS A STUB } // end getAllLessThan /** * Checks if all the elements of the given set are also included in the other set * * @param otherSet set to check * @return returns true if all the elements of the given set are also included in the other set */ public boolean isSubset(ArraySetWithArray otherSet) { // TODO Project 2 // one return statement per method please // utilize difference method return false; // THIS IS A STUB } /** * Move the first element to be the last in the set by rotating the elements */ public void moveFirstToEnd() { // TODO Project2 } 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago

Question

2. Discuss the types of messages that are communicated nonverbally.

Answered: 1 week ago