Question: The actual Set interface in the java.util package has several methods that are beyond those implemented by our search tree in this chapter. Write a
The actual Set interface in the java.util package has several methods that are beyond those implemented by our search tree in this chapter. Write a version of SearchTree that adds some or all of these methods. The methods to add are the following (some headers are slightly modified; see the Java API Specification for descriptions of each method):
- public void addAll(SearchTree tree)
- public void clear()
- public boolean containsAll(SearchTree tree)
- public boolean equals(Object o)
- public boolean isEmpty()
- public boolean remove(Object o)
- public void removeAll(SearchTree tree)
- public void retainAll(SearchTree tree)
- public Object[] toArray()
Step by Step Solution
3.32 Rating (161 Votes )
There are 3 Steps involved in it
import javautilTreeSet public class Main public static void mainString args TreeSet tree new TreeSet ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
2079_60f58f34f38f7_861001.pdf
180 KBs PDF File
2079_60f58f34f38f7_861001.docx
120 KBs Word File
