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
Byte pair encoding is a data encoding technique. The encoding algorithm looks for pairs of characters that appear in the string
erica [24]

Answer:

C. Byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.

Explanation:

Byte pair encoding is a form of encoding in which the most common pairs of consecutive bytes of data are replaced by a single byte which does not occur within the set of data.

For example, if we has a string ZZaaAb, it can be encoded if the pairs of string ZZ are replaced by X and the second pair by Y. So, our data now becomes XYAb.

To get our original data, that is decode it, we just replace the data with the keys X = ZZ and Y = aa thus allowing our original data to be restored.

Since our original string is restored without loss of data, it implies that <u>byte pair encoding is an example of a lossless transformation because an encoded string can be restored to its original version.</u>

8 0
2 years ago
Give two relative advantages of the GUI over the CL
Juliette [100K]

Answer:

GUI (Graphic User Interface) Can be used for images whereas CL Focuses on Text Imports

Info:

Here's One Try To Finish It With The Other

3 0
2 years ago
A town government is desinging anew bus system
Kamila [148]

Answer:

Umm what? Are you talking about the type of problem it is? If so it is an optimization problem.

Explanation:

I had something like this for one of my tests and I chose the optimization problem because it finds the values of decision variables that result in a maximum or minimum of a function.

But ion know if it's this that you are talking about

3 0
2 years ago
What would be a suitable device to transfer 12 photos from one PC to another?
Arlecino [84]

Answer:

A memory stick.

Explanation:

A memory stick can be defined as a storage media device with flash memory. They are mainly used in smart or portable electronic devices such as mobile phones, digital cameras, mp3 players, camcorders, etc.

Memory sticks are usually small in size and as such are easily accessible for the transfer of digital files such as images, videos, audios from a portable device or computer to another device such as a computer.

Hence, a memory stick would be a suitable device to transfer 12 photos from one PC to another.

3 0
3 years ago
More a poster appealing people to be aware <br>against bullying​
Leya [2.2K]

Answer:

Cool

Explanation:

5 0
2 years ago
Other questions:
  • Define the method object inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids.Sample output for the g
    11·1 answer
  • With a(n) ____ structure, you perform an action or task, and then you perform the next action in order.
    6·1 answer
  • Write a program that loops one thousand times. add all the even numbers and display the results. add all the odd numbers and dis
    13·1 answer
  • You have a new phone. What determines what type of messages you can send?
    15·1 answer
  • This process can be applied to help workers choose the best telecommunications technology to do a specific task.
    6·2 answers
  • Given that k refers to a non-negative int value and that t has been defined and refers to a tuple with at least k+1 elements, wr
    12·1 answer
  • Sort short_names in reverse alphabetic order.
    11·1 answer
  • is skill in using productivity software, such as word processors, spreadsheets, database management systems, and presentation so
    10·1 answer
  • When using bits to represent fractions of a number, can you create all possible fractions? Why or why not?
    13·1 answer
  • Compare and contrast the leadership and leadership and management style of apple and Samsung ​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!