Question: In this bob, you wil create a backend class called 5 ortableset. Aset, in computer science. is an unardered collection of unique objects, In our
In this bob, you wil create a backend class called 5 ortableset. Aset, in computer science. is an unardered collection of unique objects, In our Sortable Set. all of the objects in the sof will alio be inmatable at the set level. This means that even if the data class used to create oujects is not inmeutable once they are in the set they are. We do this by making a deep copy of any objects being added to the set of returned tram the set. The objects stored in the Sortableset must implement an intertace called Sortable that provides a numeric sorting bey and a deep copy method. Sortablesel alvo takes advantage of two custom exception chases: Duplicatefecteption and Invalidikerfixception Finally, the "sortable" part of SortableSet is inplemeoted by a getSortedtist method thot mykes a deep? copy of every objoct in the set swes them to an arryy, and then sorts them based on each objects sortine key. The sart alporithm used is a recurtheradix sort modihed to work with object. Details
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
