Question
Please Implament heapsort. there is a spot where you would input the code.this is C++ programming (Shell) Operating system task scheduling simulation // //-------------------------------------------------------------------- //
Please Implament heapsort. there is a spot where you would input the code.this is C++ programming
(Shell) Operating system task scheduling simulation // //--------------------------------------------------------------------
// Simulates an operating system's use of a priority queue to regulate // access to a system resource (printer, disk, etc.).
#include
using namespace std;
//-------------------------------------------------------------------- // // Declaration for the task data struct //
struct TaskData { int getPriority () const { return priority; } // Returns the priority. Needed by the heap.
int priority, // Task's priority arrived; // Time when task was enqueued
};
//--------------------------------------------------------------------
int main() { PriorityQueue
// Seed the random number generator srand((unsigned int)time(NULL));
cout << endl << "Enter the number of priority levels : "; cin >> numPtyLevels;
cout << "Enter the length of time to run the simulator : "; cin >> simLength;
for (minute = 0; minute < simLength; minute++) { // Dequeue the first task in the queue (if any). // Your code here
// Determine the number of new tasks and add them to // the queue. // Your code here
}
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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