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
Elan Coil [88]
3 years ago
9

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 spend 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. 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 ow algorithm alone to determine the answer.)
Computers and Technology
1 answer:
leonid [27]3 years ago
6 0

Answer:

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
Which type of network topology connects multiple devices to a central device?
Morgarella [4.7K]
Star topology is your answer

6 0
4 years ago
When working with arrays, most programming languages perform ________, which means they do not allow programs to use invalid sub
Allisa [31]

Answer:

The answer is "Option 2"

Explanation:

In the given question the answer is "array bounds checking", It Checks the limits by providing a way, that Specifies whether a value is inside those limits has been used. It is a variable, that falls into a given class or function called as an array index of array, that's why all option are wrong, that is explained as follows:

  • In option 1, It uses provides security, that's why it is wrong.
  • In option 3, It works on the bits, that's why it is not correct.
  • In option 4, It uses two thing that is "array bound checks and sub-script of bond", that's why it is wrong.

8 0
3 years ago
Which option ensures that page break is automatically inserted ahead of a specific paragraph or heading?
xxTIMURxx [149]

Answer:

The "Page breaks before" option is the correct approach.

Explanation:

  • This attribute specifies whether such a page interruption could perhaps appear just before any component to something which applies.
  • This says that you would like this particular section to succeed at the beginning of that same page, irrespective of what it's about, they are being used for paged multimedia, for example, printed publications and otherwise texts or paperwork.
7 0
3 years ago
What is the number 232 in binary
Gnesinka [82]

Answer:

Step 1: Divide (232)x_{10} successively by 2 until the quotient is 0:

232/2 = 116, remainder is 0

116/2 = 58, remainder is 0

58/2 = 29, remainder is 0

29/2 = 14, remainder is 1

14/2 = 7, remainder is 0

7/2 = 3, remainder is 1

3/2 = 1, remainder is 1

1/2 = 0, remainder is 1

Step 2: Read from the bottom (MSB) to top (LSB) as 11101000.

So, 11101000 is the binary equivalent of decimal number 232

(Answer).

5 0
3 years ago
Read 2 more answers
Helppp meeeeeeeeeeeeeee
Maru [420]

Answer:

A

Explanation:

this is the god i think they worship

4 0
3 years ago
Other questions:
  • Which applicants would be best suited for which jobs based on educational and training? Boris is best suited to be an Electricia
    11·2 answers
  • _____ documentation is designed to help programmers and systems analysts understand the application software and maintain it aft
    12·1 answer
  • Desktop operating systems sometimes are called ______ operating systems because they also work in conjunction with a server oper
    10·1 answer
  • What is call by reference in function of c​
    13·1 answer
  • What translates binary data into images on a monitor?
    8·1 answer
  • What is the output of the first and second print statements?
    13·1 answer
  • Use______ to format cells when they meet a certain criteria.
    13·1 answer
  • Setting up a desktop computer for anAutoCADspecialist who needs a minimum of 125 GBram which operating system would be the best
    5·1 answer
  • there is a structure called employee that holds information like employee code, name, date of joining. Write a program to create
    13·1 answer
  • Cho lược đồ CSDL “Quản lý BÁN HÀNG” có các bảng như bên dưới. (Thuộc tính in đậm và
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!