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
Rita used information from a blog that someone else wrote. What should she do?
Shkiper50 [21]

Answer:

rita should either ask the original author for permission to use her blog, but the best answer woyuld be that she should site her sources.

Explanation:

7 0
3 years ago
Key Categories: more libraries and thousands of functions
stich3 [128]





b. power
YOUR WELXOME



4 0
3 years ago
8. T/F: At the bottom of a slide you are working on you can enter notes to indicate what yo
Crazy boy [7]

Answer: True. Hope it helps!

4 0
3 years ago
LAB: Winning team (classes)
andrey2020 [161]

Answer:

The function is as follows:

def get_win_percentage(self):

       return self.team_wins / (self.team_wins + self.team_losses)

Explanation:

This defines the function

def get_win_percentage(self):

This calculates the win percentage and returns it to main

       return self.team_wins / (self.team_wins + self.team_losses)

<em>See attachment for complete (and modified) program.</em>

Download txt
6 0
3 years ago
How could you represent the following binary color in hexadecimal? What is its numerical value? What color is it? How
Radda [10]

Answer:

White, the color value is 0xFFFFFF

Explanation:

Each segment is 8-bits, which totals to 255 in base-10 value, or 0xFF in hexadecimal.

11111111₂ == 255₁₀ == 0xFF₁₆

so

 Red    Green   Blue

11111111  11111111  11111111

 FF         FF        FF

When all 3 color values are turned on at max value (255), they produce white.

7 0
3 years ago
Other questions:
  • Classify the given items as belonging to the public domain or protected by copyright law.
    6·2 answers
  • Blogs are typically written by large companies or organizations as a way to express formal, technical, or scholarly information
    5·2 answers
  • What special member function of a class is called whenever an instance of a class is created and initialized?
    15·1 answer
  • A _____ is a climate-controlled building or set of buildings that houses database servers and the systems that deliver mission-c
    6·1 answer
  • A personal computer system is composed of the processing unit, graphics board, and keyboard with reliabilities of 0.976, 0.785,
    8·1 answer
  • 12While trying to solve a network issue, a technician made multiple changes to the current router configuration file. The change
    5·1 answer
  • Read the following example cover letter:
    7·2 answers
  • Carlos had 194 seeds and 11 flower pots he put the same number of seeds in each flower pot which is the best estimate for the nu
    6·1 answer
  • Goals of the project objectives
    6·1 answer
  • Write a declaration of a variable named count that can be used to hold numbers like 90000 and -1 and -406.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!