Question: in python please There are n processes to be executed, where the ith process takes execution[i] amount of time to execute. Two processes are cohesive
![ith process takes execution[i] amount of time to execute. Two processes are](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f301633e618_63466f30162d36de.jpg)
There are n processes to be executed, where the ith process takes execution[i] amount of time to execute. Two processes are cohesive if and only if their original execution times are equal. When a process with execution time execution[i] is executed, it takes execution [i] time to complete and simultaneously reduces the execution time of all its cohesive processes to ceil(execution[i] / 2). Given the execution time of n processes, find the total amount of time the processor takes to execute all the processes if you execute the processes in the given order, i.e. from left to right. Notes - The ceil() function returns the smallest integer that is bigger or equal to its argument. For example, ceil( (1.1)=2, ceill (2.5)= 3, ceil (5)=5, etc. - If the execution time of some process i is reduced and becomes equal to the execution time of any other process j. then the two processes i and j are not considered cohesive. Example The number of processes is n=6, and their execution times are execution =[5,5,3,6,5,3]. Their execution can be visualized as follows where each set of cohesive processes is marked with a different color. Evamnlo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
