1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lys-0071 [83]
3 years ago
7

Consider the following generalization of the Activity Selection Problem: You are given a set of n activities each with a start t

ime si , a finish time fi , and a weight wi . Design a dynamic programming algorithm to find the weight of a set of non-conflicting activities with maximum weight.
Computers and Technology
1 answer:
victus00 [196]3 years ago
4 0

Answer:  

Assumption: Only 1 job can be taken at a time  

This becomes a weighted job scheduling problem.  

Suppose there are n jobs

   Sort the jobs according to fj(finish time)

   Define an array named arr to store max profit till that job

       arr[0] = v1(value of 1st job)

       For i>0. arr[i] = maximum of arr[i-1] (profit till the previous job) or wi(weight of ith job) + profit till the previous non-conflicting job

   Final ans = arr[n-1]

The previous non-conflicting job here means the last job with end timeless than equal to the current job.  

To find the previous non-conflicting job if we traverse the array linearly Complexity(search = O(n)) = O(n.n) = O(n^2)  

else if we use a binary search to find the job Complexity((search = O(Logn)) = O(n.Log(n))

You might be interested in
A. True
Ksivusya [100]
True 
You can only do it ascending because you will get confused 
7 0
4 years ago
Which service uses a broadband connection?
Sidana [21]

Answer:

d

Explanation:

because all in one question form

5 0
3 years ago
When summarizing graphs of categorical​ data, report the​ _______ and describe the​ _______?
Alex_Xolod [135]
Hello <span>Rouahidy7821 
</span><span>

Answer: When summarizing graphs of categorical​ data, report the​ models and describe the​ </span><span>variability. 
</span>
Hope this helps
-Chris
7 0
4 years ago
Which of the following statements is false?
SOVA2 [1]
People can use software to make their lives more enjoyable
5 0
2 years ago
At higher doses what behaves like PCP causing feelings of power and invulnerability
ser-zykov [4K]
I don't think any answer would be correct, if you have an option "none of the above" then that would be the correct answer
5 0
3 years ago
Other questions:
  • Some smartphones use ______ text, where you press one key on the keyboard or keypad for each letter in a word, and software on t
    13·1 answer
  • A file must be ________ before data can be written to or read from it. closed opened buffered initialized none of these
    11·2 answers
  • If you want to have certain icons available regardless of what tab you're using, you should add them to the
    14·1 answer
  • Write a new program called Lab7D that will read strings from a text file and turn them into "encrypted code". Create a bool func
    14·1 answer
  • Henry is studying the effects of deforestation along the slopes of hills and mountains. He wants to take a photo of a mountain s
    14·1 answer
  • Howard is leading a project to commission a new information system that will be used by a federal government agency. He is worki
    7·1 answer
  • 100 points please hurry!!!
    14·2 answers
  • How are IP addresses usually written?
    7·1 answer
  • If you are worried that team members will not keep sensitive information private, you could ask them to sign a ________ agreemen
    15·1 answer
  • Your network has been having problems lately when users are participating in video conferences - the video and audio stutters ve
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!