Q2 12 Please use the y from above (it is a constant number) What is your y from question 1? 9 We will run a Greedy selection algorithm on a sample set of data such that The algorithm with the greedy strategy of selecting the activity that is compatible with the current set of activities, that is the earliest to finish. Generate a random array with 5 integers between 10y and 11y. what is your array? (7,3,9, 4,8) Now create array B such that B[i]=A[i]+y For all $i$ let A[i] be the start time of activity i and B[i] be the finish time of activity i. Run your greedy algorithm showing on these 5 activities. Show your work.

icon
Related questions
Question

Please solve the following computer science problem asap (Show all work)

Q2
12
Please use the y from above (it is a constant number)
What is your y from question 1?
9
We will run a Greedy selection algorithm on a sample set of data such that
The algorithm with the greedy strategy of selecting the activity that is compatible
with the current set of activities, that is the earliest to finish.
Generate a random array with 5 integers
between 10y and 11y.
what is your array?
(7,3,9, 4,8)
Now create array B such that B[i]=A[i]+y
For all $i$ let A[i] be the start time of activity i and B[i] be the finish time of activity i.
Run your greedy algorithm showing on these 5 activities. Show your work.
Transcribed Image Text:Q2 12 Please use the y from above (it is a constant number) What is your y from question 1? 9 We will run a Greedy selection algorithm on a sample set of data such that The algorithm with the greedy strategy of selecting the activity that is compatible with the current set of activities, that is the earliest to finish. Generate a random array with 5 integers between 10y and 11y. what is your array? (7,3,9, 4,8) Now create array B such that B[i]=A[i]+y For all $i$ let A[i] be the start time of activity i and B[i] be the finish time of activity i. Run your greedy algorithm showing on these 5 activities. Show your work.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer