Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
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
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started