Not every detail is spelled out for you in the java collections homework collections homework descriptions. You will need to read the Java Documentation to fill in some of the details.
You will need to be able to apply the various ways we managed abstraction, as discussed over several lectures. You will have two main tasks in this assignment. The first is to create an Java collections homework class of useful methods, described below. The second is to provide an implementation of a Priority Queue subject to the restrictions outlined below that extends the Java Java collections homework Framework.
For the java collections homework task you should make a java collections homework effort to write as little original code as possible, but still satisfy the restrictions given for the design of the Priority Queue. Remember, homework idea of the Java Collections Framework is to provide you with a set of already-written and tested!
Design an Algorithms class Design a class called Algorithms. The Java collections class will also provide a method homework inserting an item into a sorted ArrayList.
Selection Sort Selection Sort works as follows: When the program processes /example-of-an-analytical-essay-introduction.html list of java collections homework for the first time, homework finds the location of the smallest item in java collections homework list.
It then swaps the first item in the list with the smallest one even if the smallest java java collections homework is already in the first java collections homework. Next time around, it does the same, but only with the rest of the list, i. Continue reading third time java collections homework, it starts with the third item, because the first two are already in the correct places, java collections homework so on.
This is hard to do with recursively constructed lists, but is much easier when we can directly swap two items at specific locations, as is read article case when the data is stored java collections homework an ArrayList.
It is possible to combine all parts of the Selection Sort algorithm into one method, but that is not a good way to design programs. Your program should java collections homework the following helper methods: The method inserts the new element into the ArrayList in the proper java collections, maintaining the java collections homework in sorted order. You may use this method when implementing java link homework Priority Queue, in Part 2.
Of course, java collections homework need to test your java java collections homework homework.
Construct JUnit tests for each individual method in the Algorithms class. Make a simple java collections homework of data, such as a Book or Song or something of your own choosing. Define two different Click for this class.
Then make examples of ArrayLists of these data items and make sure your JUnit tests use both of the Comparators. Implement a Priority Queue and add it to the Java Collections Framework In class we talked about the Priority Queue data structure that models situations like patients waiting to homework seen in a hospital emergency room. In an emergency room, the triage java collections homework assigns java collections homework priority java collections homework each patient as he java collections homework she arrives.
Patients are seen in order according java collections homework priority; in this case, the more severe the injury or illness, java collections homework higher the patient's priority.
The ArrayList should be maintained in sorted java collections homework so that the item with the highest priority will always be the first zeroth item in the ArrayList. The Priority Queue should provide the following methods: Construct JUnit tests for each method defined in your PriorityQueue class. Provide an Java collections homework class that defines a main method that demonstrates the functionality of your PriorityQueue class.
You should create examples of priority queues composed of Books, Songs, or whatever your favorite class is. Create at least two different priority queues, /essay-help-site-wwwessay-helpcom.html prioritized according to different Comparators.
2018 ©