CMPU-102 Spring, 2020 Pete Lemieszewski Remote Lab 3 For This lab, we will implement the specifications for the set ADT (Abstract Data Type). Start by using the linked list implementation from Remote Lab 2. There are two additional implementations for you to complete, one for extra credit. The Set collection only contains unique elements, or is empty. The ADT specifications for a set are defined in the ISet interface and are included here: 1. add: add an element to the set, if possible. returns: true, if the element is added false, if the element could not be added 2. contains: determines whether a given element is in the set. returns: true, if the element exists in the set false, if the element does not exist in the set 3. remove: removes an element from the set returns: true, if the element exists, and is removed from the set false, if the element does not exist in the set 4. getSize: provides the number of elements in the set returns: the number of elements in the set 5. toString: provides a String representation of the elements in the set returns: String object that can be used to display the elements in the set. The classes for the various implementations of this interface: 1. SetMyLinkedList: uses the list class you created during the the last lab as the underlying data structure. Be sure to copy your own list code over to the MyLinkedList class. 2. SetJavaLinkedList: uses the java.util.LinkedList class. The following java.util.LinkedList methods are recommended: - add(E elem): append elem to end of list. Always returns true. - add(int idx, E elem): insert elem at index idx. - remove(int idx): removes and returns element at index idx. - get(int idx): returns element at index idx. - indexOf(Object o): returns index of object o, if it is present in the list, or -1 otherwise. The Object.equals() method is used for the comparison. - size(): returns the length of the list. 3. SetJavaArrayList: for extra credit! implement using the java.util.ArrayList class. ArrayList supports the same basic methods as java.util.LinkedList. ------------------------------------------------------------------------------------- Benchmarking Class "SetTest" is provided for you to test and benchmark your code with. For each of the different implementations, it creates an empty set, adds 50000 elements, tests their existence and then removes them. Elements are tested for existence and removed in a random order. Assert statements are used to test correctness. Furthermore, this class also times each of the implementations to show you how their performance compares. Analyze the code until you understand what it does and then run the main method. If your code is correct, main should not throw any AssertionErrors and should print out timing information for each of the different set implementations. Note: since assertions are used to test correctness, be sure to use the -ea flag to enable assertions if running java outside of BlueJ. -------------------------------------------------------------------------------- For extra credit: (I'll accept extra credit assignments through Friday) Use the array-based list code we saw in class to create your own array-based set implementation and test it against the others. -------------------------------------------------------------------------------- Upon completion Once the program is working as specified, please contact a coach or professor to check your work and give you credit. Finally, compress your source files using zip, tar or another of your favorite compression utilities and submit them through Moodle. (Yes, I have it set up! https://moodle.vassar.edu/mod/assign/view.php?id=618632)