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
Nikolay [14]
3 years ago
6

My friend Leo wants to have an emergency plan for his final exams on University of Southern Algorithmville. He has N subjects to

prepare for, and for each subject, his score is determined only by the time he spends on learning. It’s not surprising that Leo found out he actually spent zero time on preparing before.At least he knows when he can start learning all of these subjects. For each subject i there is a start time si when he can get all materials ready to start learning. And there is also a ending time ei for each subject, when his learning materials expire and he can’t learn anymore. We know that si and ei are integers, and Leo can only dedicate to a single subject within each time phase.In Universtiy of Southern Algorithmville (USA), a student’s total grade is the minimum grade among all subjects. Leo wants you to help him find out the best outcome. Given N subjects and their time intervals (si,ei), design an algorithm to find out the maximum time possible for the least prepared subject. Prove the correctness of your algorithm. (Hint: It’s not enough to use the network flow algorithm alone to determine the answer.)
Computers and Technology
1 answer:
Brut [27]3 years ago
8 0

Answer:

Greedy algorithm

Explanation:

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy algorithms are used for optimization problems. An optimization problem can be solved using Greedy if the problem has the following property: At every step, we can make a choice that looks best at the moment, and we get the optimal solution of the complete problem.

If a Greedy Algorithm can solve a problem, then it generally becomes the best method to solve that problem as the Greedy algorithms are in general more efficient than other techniques like Dynamic Programming. But Greedy algorithms cannot always be applied. For example, the Fractional Knapsack problem (See this) can be solved using Greedy, but 0-1 Knapsack cannot be solved using Greedy.

The following are some standard algorithms that are Greedy algorithms.

1) Kruskal’s Minimum Spanning Tree (MST):

In Kruskal’s algorithm, we create an MST by picking edges one by one. The Greedy Choice is to pick the smallest weight edge that doesn’t cause a cycle in the MST constructed so far.

2) Prim’s Minimum Spanning Tree:

In Prim’s algorithm also, we create an MST by picking edges one by one. We maintain two sets: a set of the vertices already included in MST and the set of the vertices not yet included. The Greedy Choice is to pick the smallest weight edge that connects the two sets.

3) Dijkstra’s Shortest Path:

Dijkstra’s algorithm is very similar to Prim’s algorithm. The shortest-path tree is built up, edge by edge. We maintain two sets: a set of the vertices already included in the tree and the set of the vertices not yet included. The Greedy Choice is to pick the edge that connects the two sets and is on the smallest weight path from source to the set that contains not yet included vertices.

4) Huffman Coding:

Huffman Coding is a loss-less compression technique. It assigns variable-length bit codes to different characters. The Greedy Choice is to assign the least bit length code to the most frequent character.

The greedy algorithms are sometimes also used to get an approximation for Hard optimization problems. For example, the Traveling Salesman Problem is an NP-Hard problem. A Greedy choice for this problem is to pick the nearest unvisited city from the current city at every step. These solutions don’t always produce the best optimal solution but can be used to get an approximately optimal solution.

You might be interested in
When recording a song on her laptop, Sarah noticed a slight delay in what she could hear on her headphone and what she was recor
PolarNik [594]

Answer:

latency

Explanation:

We could have latency if we want to record with a computer, and then we try to hear that record with the headphone.

This is an audio card's characteristic, this is a time between the input, in this case, Sarah recording, and the output Sarah's headphone.

The computer needs time to process the signal, and for that there is latency, but this depends on more of the operative system and the CPU in your computer than the audio card.

6 0
4 years ago
Andrew is researching a new operating system for the computers at his workplace. His boss wants the computers to be able to conn
Bumek [7]

Answer:

Windows 8.1 Core

Explanation:

In this particular example, we're going to use Windows 8.1 Core, is the most basic of the window's family, in this case, only we need an OS to connect the hardware with the cloud computing for security and is not necessary another license, in addition, Windows 8.1 core is easiest to use, is so friendly with the user.

6 0
3 years ago
What would be the result after the following code is executed? int[] numbers = {40, 3, 5, 7, 8, 12, 10}; int value = numbers[0];
maw [93]

Answer:

The value variable will contain the lowest value in the numbers array.

Explanation:

Given

The given code segment

Required

The result of the code when executed

The illustration of the code is to determine the smallest of the array.

This is shown below

First, the value variable is initialized to the first index element

int value = numbers[0];

This iterates through the elements of the array starting from the second

 for (int i = 1; i < numbers.length; i++) {

This checks if current element is less than value.

     if (numbers[i] < value)

If yes, value is set to numbers[i]; which is smaller than value

value = numbers[i];

<em>Hence, the end result will save the smallest in value</em>

7 0
3 years ago
A placeholder for information that will be placed in a document is a _____.A. wizard B. merge field C. merge or D.hyperlink. The
geniusboy [140]

Merge Fields

Merge fields are fields that contain placeholders where you can put email templates such as addresses and greetings. In addition to email templates, you can put mail merge templates and custom links. For instance, a user can place a merge field in an email template so that the salutation or the greeting includes the recipient's name rather than a simple "Hi" or "Hello".

ALT + CTRL + D

From time to time, you may find it important to insert endnotes in your Word document. By default, endnotes appear at the end of the document and a number on endnotes matches up with a reference mark. To insert an endnote, you can click the reference tab or hit the combination keys ALT + CTRL + D

Yes

There are many ready-to-use Microsoft Document Templates available online that can help you jump start your project. If you are searching for a particular layout or style template and you cannot find it, you do not have to create one from scratch. You can search for thousands of templates in the Microsoft Office Online site

4 0
3 years ago
Read 2 more answers
It is next to impossible for someone to prove that information I used in a class assignment came from somewhere on the Internet/
Rashid [163]

Answer:

False

Explanation:

It is wrong to say that plagiarism can not be detected, there is a wide range of technologies available to prove that the information provided that a person is gotten directly from a source and it was not His own words. Plagiarism checking tools include web applications and software made to check plagiarism and they available for use, most of which are paid software and some are free.

3 0
3 years ago
Other questions:
  • g Suppose the vertex data is stored in an array named verts and each vertex uses a list to store the coordinates. Write the code
    7·1 answer
  • Which tool do you think would be the most useful if you were designing a logo for a business?
    6·2 answers
  • Why is it important to evaluate the website on which you plan to shop?
    13·1 answer
  • As an experienced networking professional, you are asked to conduct a posture assessment on a local credit union’s network. The
    12·1 answer
  • What is the name given a technological program that typically copies itself and moves through a computer system in order to disr
    10·1 answer
  • 11) A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one chil
    7·1 answer
  • second question today 25 POINTS: What is the formula to balance a lever when both effort and resistance are present?
    14·1 answer
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
  • Hayne is starting his own business as a psychotherapist and needs to post a website advertising his services,contact information
    14·1 answer
  • Can someone please help me! It’s due Thursday!
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!