Question: 1 . ( 1 0 points ) Consider the problem of scheduling ( n ) jobs of known durations ( t _
points Consider the problem of scheduling n jobs of known durations t tldots for execution by a single processor. The jobs can be executed in any order, one job at a time. You want to find a schedule that minimizes the total time spent by all the jobs in the system. The time spent by one job in the system is the sum of the time spent by this job in waiting plus the time spent on its execution. Design a greedy algorithm for this problem.
Consider jobs with durations t
Now, calculate the waiting times and total time spent for each job:
Job : Waits time, executes for units, total time
Job : Waits time units, executes for units, total time
Job : Waits time units, executes for units, total time
The total time spent by all jobs
a points Code implementation
b points Screenshot
points Apply Prim's algorithm to the following graph.
a points Code implementation
b points Screenshot points Apply Kruskal's algorithm to find a minimum spanning tree of the following graphs.
a points Code implementation.
b points Screenshot
points Solve the following instances of the singlesource shortestpaths problem with vertex a as the source.
a points Code implementation.
b points Screenshot
points
a points Construct a Huffman code for the following data:
b points Encode A B A C A B A D using the code of question a
c points Decode using the code of question a
points Given two integers k and n find all possible combinations of k unique positive integers from the set ldots that sum up to n Each combination must consist of distinct integers, and the integers within each combination must be in ascending order. Write a function combinationSum that takes in two parameters, k and n and returns a list of lists, where each inner list represents a valid combination of integers.
a points Code implementation.
b points Screenshot for mathrmnmathrmk ; mathrmnmathrmk
points Given a sequence nums, that may contain duplicate numbers, return all unique permutations of the sequence in any order. Write a function permuteUnique that takes a list of integers and returns a list of lists, where each inner list represents a unique permutation of the input sequence.
a points Code implementation.
b points Screenshot for nums ; nums
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
