Question: Question 1 [ 1 0 ] setting up . Code must be in java.Please follow each instruction Study the class definitions below: class Node {
Question setting upCode must be in java.Please follow each instruction
Study the class definitions below:
class Node
attributes
String flightno; flight number
Date arrivaltime; time at which flight lands
class PriorityQueue
attributes
int currentSize;
Node root;
FlightNode array new Node ;
methods
void clear;
Boolean isEmpty;
Boolean addNode x;
Node remove;
void percolateDownint hole;
Create two files Node.java and PriorityQueue.java
Copy the above definitions into the corresponding files
Write code for a default and a loaded constructor for Node
Write code for a default and a loaded constructor for PriorityQueue
Write accessor and mutator methods for the attributes of Node
Write accessor and mutator methods for the attributes of PriorityQueue
Question adding functionality
Extend the PriorityQueue class:
Write code for the method void clear which empties the heap and resets the
size to
Write code for the method Boolean isEmpty that checks whether the heap
contains any elements or not.
Write code for the method Boolean addNode x which adds a new node to
the heap
Write code for the method Node removewhich deletes the root, decreases the
heap size and reorders the remaining heap. It should involve a call to a method
percolateDownint hole
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
