Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the Round Robin Scheduler as described in attached notes Round Robin Scheduler Example.pdf using queue (you can use either ArrayQueue or LinkedQueue), based on

image text in transcribed
image text in transcribed
Implement the Round Robin Scheduler as described in attached notes "Round Robin Scheduler Example.pdf" using queue (you can use either ArrayQueue or LinkedQueue), based on the provided starter Python code "robin_scheduler.py". In the starter file, three tasks have already been set in a tasks list according to the example in the attached document. You are only asked to complete the method "scheduling". Once you finish your code based on the starter code and run it, the output should be same as bellow. You should test your code using more examples. Task ID: 92 Task TD: P: Task ID: PR Arrival time: 130 Arrival time: 50 Arrival times a Task time: 75 Complete at: 375 Task time: 170 Complete at: 446 Task time: 252 Complete at: 496 Completion time: 246 Completion time: 395 Completion time: 495 waiting time: 170 Waiting time: 225 waiting time: 245 Note: Please also read carefully the code and comments in the starter code. Implement a class StatQueue inheriting from the class LinkedQueue in the Python file linked_queue.py) to support additional operations, including min(), max(), and mean(), which return the minimum, maximum, and mean values of the elements in the queue, respectively. Assuming the elements in the queue are numbers. These above operations should run in a constant time; this means that you should maintain corresponding member variables to store minimum, maximum and mean element values (you can name them_min, max, and mean respectively). These member variables should be updated each time either when dequeue or enqueue operations are performed. Such that the operations dequeue() and enqueue(e) should be rewrote in the StatQueue class to support updating these member variables. The StatQueue class should continue supporting all other regular operations, such as first(), len(), and is_empty, by inheriting them from the LinkedQueue class without further implementation. Note: When you implement (rewrite) dequeue() in the StatQueue class, you should write code to check whether the value of the removed element is the_minor_max. If yes, you should conduct a search among the elements for the minimum or maximum values and update the minor_max correspondingly. Similarly, you should update_min and max in enqueue(e) method when it is needed, the only difference is that it does not require a search for minimum or maximum value in the enqueue operation. The mean should be updated in both enqueue(e) or dequeue() methods. it does not matter whether the to-be-removed element is minimum/maximum or not

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions

Question

1. How do most insects respire ?

Answered: 1 week ago