Question: Write Java-correct implementations of these methods: -lower The goal is to make these methods behave exactly like they would for a Java TreeSet. (Basically need

Write Java-correct implementations of these methods: -lower

The goal is to make these methods behave exactly like they would for a Java TreeSet. (Basically need to write the .lower() method that is in Java's TreeSet in this custom class SearchTreeSet):

(The class shown is a snippet of the way we should write these methods, the lower method is at the very bottom and unwritten)

 Write Java-correct implementations of these methods: -lower The goal is to

make these methods behave exactly like they would for a Java TreeSet.

(Basically need to write the .lower() method that is in Java's TreeSet

package util: import java.util.Arrays import java.util.comparator import java.util.Iterator; import java.util.Random; import adapter.NavSetAdapter; import java.util.Collection; import java.util.Sortedset; public class SearchTreeSet extends NavSetAdapter private static final long serialVersionUID-1L; private static class Node E> E data; Node left, right; Node (E data, Node left, Node right) this.datadata this. left left; this.right - right: private NodexE> root null; private int size 0; private Comparator super cmpnuli: public SearchTreeSet (Comparator super E> cmp) { this.cmpcmp: public SearchTreeSet) i eSuppressWarnings ("unchecked") private int myCompare (E lhs, E rhs) [ if (cmp-null) return (ComparablexE>) lhs) . compareTo (rhs) else return cmp. compare (lhs, rhs)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!