Implement the poll() method in PriorityQueue.java file. This method will return null if the tree is.
Implement the poll() method in PriorityQueue.java file. This method will return null if the tree is empty. Otherwise, it will remove the root from the Heap and return the value from the root. This is what I have so far dont know what I am doing wrong public E poll() { if(heap.isEmpty()) return null; else heap.removeRoot(); return heap.getRoot().getElement(); } Implement the clear() method in PriorityQueue.java file. This method will not throw any errors on an empty Heap. It will remove all nodes from the Heap so that is is empty. public void clear() { //Task 4: Your code here… //No errors on an empty heap //remove all nodes from heap } May 13 2022 07:28 PM
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more