![]() |
Given an array arr[] representing the time required to complete n tasks. Each task has a specified time required for its completion. In each operation, one task is selected as the primary task and is executed for x units of time, while all other tasks are executed for y units of time, where y < x. A task is considered complete when it has been executed for at least the specified time required for its completion. Find the minimum number of operations required to completely execute all tasks if the process runs optimally. Examples:
Approach: Follow the below steps to solve the problem
Step-by-step algorithm:
Below is the implementation of the approach:
Output 3 3 Time Complexity: O(n * log(max(arr[]))), where n is the number of tasks and arr[] is the array storing the required time to complete a job. |
Reffered: https://www.geeksforgeeks.org
DSA |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |