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
REY [17]
3 years ago
14

"Suppose that instead of always selecting the first activity to finish, we instead select the last activity to start that is com

patible with all previously selected activities. De- scribe how this approach is a greedy algorithm, and prove that it yields an optimal solution."
Computers and Technology
1 answer:
Pachacha [2.7K]3 years ago
8 0

Answer:

Explanation:

We can say according what we

already know that Greedy algorithm selects the shortest path, and we can also say that the given approach is greedy as it selects the last activity to start as it is the shortest path to take.

Now suppose we are given a set S = {x1, x2,..... , xn} (where x1, x2…. are activities), and xi = [si, fi), and we try to find an optimal solution by selecting the last activity to start that is compatible with all previously selected

activities.

Now create a set S’ = {x’1, x’2, · · · , x’n}, where x’i = [f’i, si). (x’1 = x1 in reverse). We can see that, a subset of {x1, x2, · · · , xn}⊂S is mutually compatible if and only if the corresponding subset {x’1, x’2, · · · , x’n} ⊂ S’ is also mutually compatible. Thus, an optimal solution for S maps directly to an

optimal solution for S’ and vice versa.

The given algorithm when run on S, produces the same result as the greedy algorithm when run on S’. The solution of algorithm for S corresponds to the solution of greedy algorithm for S’, and hence the algorithm is optimal.

You might be interested in
What are the two basic literary forms?
Korolek [52]
Fiction and nonfiction
6 0
3 years ago
When creating a user generated function, what procedure is followed?
marin [14]

When creating a user-generated function, what procedure is followed d) all of the above.

<h3>What are the three factors of user-described characteristic?</h3>

A user-described characteristic has 3 essential additives which might be characteristic declarations, characteristic definition and characteristic called.

The characteristic prototypes are used to inform the compiler approximately the variety of arguments and approximately the specified datatypes of a characteristic parameter, it additionally tells approximately the go-back kind of the characteristic. By this information, the compiler cross-assessments the characteristic signatures earlier than calling.

Read more about the prototype :

brainly.com/question/7509258

#SPJ1

6 0
2 years ago
(please help) What do you do if Brainly keeps saying your blocked?
kolezko [41]
You could probably make a new account if it’s just the account blocked
6 0
2 years ago
What kind of company would hire an Information Support and Service employee?
Anni [7]
A service company would hire an Information Support and Service employee.

hope it helps you!
6 0
4 years ago
Read 2 more answers
There are nearly ____ billion people in the world who do not have internet access.
o-na [289]
<span>There are nearly 4.2 billion people in the world who do not have internet access.</span>
6 0
4 years ago
Other questions:
  • Frank works for an organization that wishes to install a software program on a single server with multiple users connected. Whic
    8·1 answer
  • A device that produces a permanent human-readable text of graphic document.
    15·1 answer
  • When should an individual consider entering parenthood?
    5·1 answer
  • "Two technicians are discussing FWD driveshaft service. Technician A says that removal of the driveshaft usually requires partia
    15·1 answer
  • PLEASE ANSWER QUICK!.....I am trying to buy a computer so I can play Crysis 3 what are computers that are good for this high det
    12·1 answer
  • The main workplace of a Windows computer is called the
    14·1 answer
  • Sometimes when a baby is born they need to be kept in an incubator for a period of time. A manufacturer would like to design a n
    11·1 answer
  • What is the meaning of the concept (atomically)
    11·1 answer
  • PLZ HELP ME!!
    8·2 answers
  • What should you do if an online friend asked to meet you after school? <br>ᵖˡˢˢˢˢ...​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!