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
Given an array arr, of type int, along with two int variables i and j, write some code that swaps the values of arr[i] and arr[j
Inessa05 [86]

You'll need a helper variable for this, so depending on your programming language, the solution becomes:

int helper;

helper = arr[i];

arr[i] = arr[j];

arr[j] = helper;

3 0
3 years ago
All of this information is part of a ____ in a database.
Crank
The correct answer or solution to the question above is marked A
5 0
3 years ago
Read 2 more answers
Write a SELECT statement that returns the same result set as this SELECT statement. Substitute a subquery in a WHERE clause for
AleksAgata [21]

Answer:

SELECT DISTINCT VendorName FROM Vendors

WHERE VendorName= ANY (SELECT VendorName FROM Vendors JOIN Invoices ON Vendors.VendorID = Invoices.VendorID) ORDER BY VendorName;

Explanation:

All bold faced words are sql keywords for different purposes. The subquery return the all values which matches the join condition  and main query will choose only distinct values and make them in order of VendorName.

There many other queries also return the same result as returned by given query.

8 0
3 years ago
Television and movies are an important medium of communication. Perform online and offline research, and describe the history of
iren2701 [21]

Answer:

The American film industry, popularly called Hollywood, has played an important role as a platform for communication. It has influenced audiences the world over. The history of Hollywood begins in 1910 with the silent movie In Old California. The 1920s saw the arrival of movies with sound and music. In the 1940s, during and after World War II, movies were made on themes related to war. In the 1950s, Hollywood movies began to compete with television, as television entered American homes. Cutting to the 1990s, the use of animation in movies began to rise. The 2000s saw a continuation of this trend. Movies are now made using the most advanced technology and effects.

Hollywood movies play an important role in the communication process. It can bridge the gap between different communities, cultures, races, and nations. For example, the movie The Help highlighted the gross discrimination the Blacks suffered during the 1960s. Movies have also played a great role in building harmony between cultures. For example, the movie Eat, Pray, Love explores Eastern cultures. Animated movies are enjoyed by movie lovers of all ages, and often end with a good message.

Explanation:

PLATO

7 0
3 years ago
Match the header to the protocol data unit where it is added. segment 1. Port ID packet 2. MAC ID frame 3. IP address​
ikadub [295]

Answer:

1. Port - Segment

2. MAC ID - Frame

3. IP address - Packet

Explanation:

Happy December to all!! :)

3 0
3 years ago
Other questions:
  • Does any body like animal jam
    11·2 answers
  • *asap* Name one of the similarities between Word and Excel.
    7·1 answer
  • The following slide was created as part of a presentation that trains new employees how to use the scheduling and calendar softw
    14·2 answers
  • Which of the following is considered part of the process in the systems thinking example of a TPS?
    6·1 answer
  • 2.2-2 Consider sorting numbers stored in array by first finding the smallest element n A of and exchanging it with the element i
    11·1 answer
  • True or false that computers that are joined together are able to share hardware and software, but not data
    11·1 answer
  • True/False
    13·1 answer
  • What is meant by the term text?
    14·2 answers
  • What is the maximum ream size on an agile project?
    15·1 answer
  • What is one of the limitations of marketing in social media?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!