Can you please help me with answering the following coding question? If you do write code, can it please either be in C or C++? Thank you Problem: Your task is to create the CPU execution scheduler where the jobs are kept in a priority queue implemented as a binary heap.  Make this a round robin type of execution where the jobs are deleted from the heap, executed for 2 time units, and re-inserted with a lower priority into the priority queue.  Jobs that have completed execution would not be re-inserted into the heap.  New jobs could come in at a priority that might be higher than the aging jobs. .   For example, the following tree represents a Maximum binary heap. Each node indicates the priority and the total execution time of each process. This a round robin type of execution where the jobs are deleted from the heap, The system assigns the next CPU time (time slice) which is 2 unit to the highest priority process. Here, the root will be deleted and will be executed for two units of time. In the following example 8 gets deleted from the binary heap. It gets executed for 2 unit of time, as a result 6 will be its new priority and the new execution time as well. It will be re-inserted into the heap As long as the total execution time is greater than 0, the task with be reinserted into the binary heap and will be allocated according to its new priority. If two process has the same priority, the system can pick either one. Code should contain the following functions: 1.  Create Binary Tree,   2. Delete,   3. Scheduling,   4. Insertion,   5. Heapify

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Question:

Can you please help me with answering the following coding question? If you do write code, can it please either be in C or C++? Thank you

Problem:

Your task is to create the CPU execution scheduler where the jobs are kept in a priority queue implemented as a binary heap.  Make this a round robin type of execution where the jobs are deleted from the heap, executed for 2 time units, and re-inserted with a lower priority into the priority queue.  Jobs that have completed execution would not be re-inserted into the heap.  New jobs could come in at a priority that might be higher than the aging jobs. .

 

For example, the following tree represents a Maximum binary heap. Each node indicates the priority and the total execution time of each process. This a round robin type of execution where the jobs are deleted from the heap, The system assigns the next CPU time (time slice) which is 2 unit to the highest priority process.

Here, the root will be deleted and will be executed for two units of time. In the following example 8 gets deleted from the binary heap. It gets executed for 2 unit of time, as a result 6 will be its new priority and the new execution time as well. It will be re-inserted into the heap

As long as the total execution time is greater than 0, the task with be reinserted into the binary heap and will be allocated according to its new priority. If two process has the same priority, the system can pick either one.

Code should contain the following functions:

1.  Create Binary Tree,   2. Delete,   3. Scheduling,   4. Insertion,   5. Heapify

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education