Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description In this lab you will create a backend class called SortableSet. A set, in computer science, is an unordered collection of unique objects. In

image text in transcribed
Description In this lab you will create a backend class called SortableSet. A set, in computer science, is an unordered collection of unique objects. In our Sortableset, all of the objects in the set will also be immutable at the set level. This means that even if the data class used to create objects is not immutable, once they are in the set they are. We do this by making a deep copy of any objects being added to the set or returned from the set. The objects stored in the Sortableset must implement an interface called Sortable that provides a numeric sorting key and a deep copy method. SortableSet also takes advantage of two custom exception classes: DuplicateException and InvalidKeyException. Finally, the "sortable" part of Sortableset is implemented by a getsortedlist method that makes a deep copy of every object in the set, saves them to an array, and then sorts them based on each object's sorting key. The sort algorithm used is a recursive radix sort modified to work with objects. Details The overall architecture of this lab is as shown here: All classes must be named as shown in the above UML diagram except the concrete ciass. JUnit tests need to be written for the SortedSet class. Be sure to test all possible outcomes of all the methods

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions