Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

by c++ - Class QueueLL. to represent the queue, this queue will be template so that it can accept any type, this class have attributes

image text in transcribed

by c++

- Class QueueLL. to represent the queue, this queue will be template so that it can accept any type, this class have attributes which are the FRONT (FRONT is like HEAD), CAPACITY (double) with default value 3 and REAR pointer, and one constructor to set them to NULL. The Queuel.1. class will have a method to take a process. the method name is bool excecute(T process) (like the enqueue method that we implemented in the labs), the method parameter is of type process, the method will only add the process object to the linked list (adding is always from the rear), you shouldn't add a process with the same process id. Implement a method to run a process, its name (TPUProcess runProcess(), it will check if the process in the FRONT, its time needed is equal to or less than the CAPACITY it will be deleted from the queue (like the dequeue method that we implemented in the labs), the method will return the deleted process and print "Process Execution is Compl Implement a method to print al. ssses in the quel. name void cpuSchedule(), use the void printirrocessinfo() from the CPUProcess class. Implement a method with name bool killProcess(StackLL, sII), the method will check the time needed of the process in the FRONT if it is gre than the CAPACITY you should de his process and add it to the using the bool pushProcess(T Process) which is in PART \#3. Implement a method to check if the queue is empty with name bool emptyQueue0, because you can't call bool killProcess(StackLL sII) to remove a process if the queue is empty. Part \#3 [Stack using Linked List]: 3 Grades In this part you're requested to implement a Stack using Linked List not using Arrays, you need to implement the following: (Consider that the stack is FILO or LIFO) - Class StackLL to represent the stack, it will be template so that it can accept any type, this class have one attribute which is the TOP (TOP is like HEAD), and one constructor to set TOP to NULL. This class will have a method to take a process (It will be called in bool killProcess() from PART \#2) then it will add it to the stack, method name bool pushPrcoess(T Process), adding will be always in the TOP. A method to print the stack contents, with name bool stackOrProcesses(). A method to get the latest process, which is the TOP of the stack, its name should be CPUProcess lateProcess(), then print the number of processes in the stack. Implement a method to check if the stack is empty with name bool emptyStack0. because you can't call CPUProcess lateProcess() if the stack is empty. Part \#4 [Complexity Analysis]: 2 Grades Calculate and show the complete steps of the complexity and T(n) equation of the bool excecute(T process) method, which is in the Queuel.L class, and show the Big O at the end

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions