Introduction对于此任务,您将编写两个更多的Priority Queue实现。 使用与程序#1相同的界面,您将实现两个链表。你的实现将是:1.有序单链表2.无序的单链表两个实现必须具有相同的行为,并且必须实现程序#1中使用的PriorityQueue接口。 这些实现必须具有单个无参数构造器。 由于链表从不填满,因此没有默认大小或最大大小。因此,您的项目将包含以下文件。 你必须使用这些文件名。?PriorityQueue.java ADT接口(在prog1中提供)OrderedLinkedListPriorityQueue.java有序列表实现。UnorderedLinkedListPriorityQueue.java无序列表实现。附加细节?每种方法都必须尽可能高效。 也就是说,如果方法可以用O(log n)复杂度编写,那么O(n2)是不可接受的。?您不得对所提供的PriorityQueue接口进行任何修改。 我将用这份文件的副本为您的项目评分。 该接口来自项目#1的UNCHANGED?第一项作业的所有相关要求适用于此。 当然,数组的大小会有限,但链表不会。 因此,所有对最大尺寸的引用都与此作业无关。?isFull()方法应该被硬编码以返回false。?您应该忽略(但不要删除)接口中的DEFAULT_MAX_CAPACITY变量。Priority queue:PriorityQueue ADT可以以任何顺序存储对象。 但是,从PQ中删除对象必须遵循特定标准.PQ最长的最高优先级对象必须是remove()方法返回的对象。 必须为相同优先级的对象保留FIFO返回顺序。优先级对象的排序由Comparable 接口确定。 所有插入到PQ中的对象都必须实现此接口。package data_structures;import java.util.Iterator;public interface PriorityQueue> extends Iterable {public static final int DEFAULT_MAX_CAPACITY = 1000;// Inserts a new object into the priority queue. Returns true if// the insertion is successful. If the PQ is full, the insertion// is aborted, and the method returns false.public boolean insert(E object);// 删除PQ中时间最长的优先级最高的对象,并将其返回。 如果PQ为空,则返回nullpublic E remove();// Deletes all instances of the parameter obj from the PQ if found, and// returns true. Returns false if no match to the parameter obj is found.public boolean delete(E obj);// Returns the object of highest priority that has been in the// PQ the longest, but does NOT remove it.// Returns null if the PQ is empty.public E peek();// Returns true if the priority queue contains the specified element// false otherwise.public boolean contains(E obj);// Returns the number of objects currently in the PQ.public int size();// Returns the PQ to an empty state.public void clear();// Returns true if the PQ is empty, otherwise falsepublic boolean isEmpty();// Returns true if the PQ is full, otherwise false. List based// implementations should always return false.public boolean isFull();// Returns an iterator of the objects in the PQ, in no particular// order.public Iterator iterator();}RequirementAddendumYour iterator must be fail-fast for both implementations.The Program:For this assignment, you will write two more implementations of a Priority Queue. Using the same interface as program #1, you will write two linked listed implementations.Your implementations will be:1.Ordered Singly Linked List2.Unordered Singly Linked ListBoth implementations must have identical behavior, and must implement the PriorityQueue interface used in program #1. The implementations must have a single no-argument contructor. As linked lists are never full, there is no default size or maximum size.Thus, your project will consist of the followJava代写Priority Queue代写Java编程、Java OrderedLinkedListPriorityQing files. You must use exactly these filenames.?PriorityQueue.java The ADT interface (provided in prog1)?OrderedLinkedListPriorityQueue.java The ordered list implementation.?UnorderedLinkedListPriorityQueue.java The unordered list implementation.Additional Details:?Each method must be as efficient as possible. That is, a O(n) is unacceptable if the method could be written with O(log n) complexity.?You may not make any modifications to the PriorityQueue interface provided. I will grade your project with my copy of this file. This interface is UNCHANGED from project #1?All relevant requirements from the first assignment apply here. Of course, arrays will have a limited size but linked lists do not. Thus, all references to maximum size are not relevant for this assignment.?The isFull() method should be hardcoded to return false.?You should ignore (but do not remove) the DEFAULT_MAX_CAPACITY variable in the interface.Priority queue:/ The PriorityQueue ADT may store objects in any order. However,removal of objects from the PQ must follow specific criteria.The object of highest priority that has been in the PQ longestmust be the object returned by the remove() method. FIFO returnorder must be preserved for objects of identical priority.Ranking of objects by priority is determined by the Comparableinterface. All objects inserted into the PQ must implement thisinterface./package data_structures;import java.util.Iterator;public interface PriorityQueue> extends Iterable {public static final int DEFAULT_MAX_CAPACITY = 1000;// Inserts a new object into the priority queue. Returns true if// the insertion is successful. If the PQ is full, the insertion// is aborted, and the method returns false.public boolean insert(E object);// Removes the object of highest priority that has been in the// PQ the longest, and returns it. Returns null if the PQ is empty.public E remove();// Deletes all instances of the parameter obj from the PQ if found, and// returns true. Returns false if no match to the parameter obj is found.public boolean delete(E obj);// Returns the object of highest priority that has been in the// PQ the longest, but does NOT remove it.// Returns null if the PQ is empty.public E peek();// Returns true if the priority queue contains the specified element// false otherwise.public boolean contains(E obj);// Returns the number of objects currently in the PQ.public int size();// Returns the PQ to an empty state.public void clear();// Returns true if the PQ is empty, otherwise falsepublic boolean isEmpty();// Returns true if the PQ is full, otherwise false. List based// implementations should always return false.public boolean isFull();// Returns an iterator of the objects in the PQ, in no particular// order.public Iterator iterator();}转自:http://ass.3daixie.com/2018052516414035.html