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
Klio2033 [76]
3 years ago
12

Your job is to prepare a lineup of n awardees at an award ceremony. You are given a list of m constraints of the form "i wants t

o receive an award before j." If you violate a constraint, it might upset the affected award recipient (i) and then i may leave the ceremony. Give an algorithm that prepares such a lineup, (or says that it is not possible) in O ( m + n ) time.
Mathematics
1 answer:
DanielleElmas [232]3 years ago
6 0

Answer:

The idea is to use the concept of topological sorting.

Complexity of this algorithm is equal to complexity of DFS algorithm, that is, O(m+n).

Step-by-step explanation:

The idea is to use the concept of topological sorting.

A topological sort also called a topological ordering of a directed graph is a linear ordering of its vertices in a way that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering. For instance, the vertices of the graph may represent tasks to be performed, and the edges may represent constraints that one task must be performed before another; in this application, a topological ordering is just a valid sequence for the tasks.

A topological sorting is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph (DAG).

For every edge (U - - >V), create a directed edge from U to V.

While creating an edge, if an edge creates a cycle, then it is not possible.

n= number of awardees

m= the number of constraint

Let n represent the vertices of a graph and constraints m is representing edges of a graph.

and graph is represented in adjacent of O(m+n)

Constraint i wants to receive award before j

Graphical representation - - - - - > (i) - - - - - - > (j) j depends on i

1. Presently run topological olding on graph G(n, m) where n is vertices and m is edges.

2. Run DFs on Graph, a temporary stack

3. Firstly call topological sorting for all its adjacent vertices and then push it to a stack. Finally, print content of stack.

4. Vertex is push to stack only when all adjacent vertices are already in stack.

Complexity of this algorithm is equal to complexity of DFS algorithm, that is, O(m+n).

You might be interested in
AB bisects angle LAX and angle LAB measures 32 degrees. Find the measure of angle LAX
ANEK [815]

check the picture below.


to bisect and angle, simply means to cut it into two equal halves, so if ∡LAB is 32°, then ∡LAX is 32° + 32°.

3 0
3 years ago
HELP ASAP!!? HELP ME PLEASE!! 10 POINTS
masha68 [24]

Answer:

D)  3x²y

Step-by-step explanation:

3 0
3 years ago
Can anyone solve these 3 problems it is worth 25 points
shusha [124]
Where are the problems?
7 0
4 years ago
Find the mean, μ, for the binomial distribution with n = 48 and p = 3/5. Round your answer to the nearest hundredth. A) μ = 29.7
qaws [65]

The mean of the binomial distribution is (d) μ = 28,8

<h3>How to determine the mean?</h3>

The given parameters of the binomial distribution are given as:

n = 48 and p = 3/5

The mean is then calculated using:

μ = np

This gives

μ = 48 * 3/5

Evaluate

μ = 28,8

Hence, the mean of the binomial distribution is (d) μ = 28,8

Read more about mean at:

brainly.com/question/15858152

#SPJ1

6 0
2 years ago
On a recent day, 8 euros were worth $9 and 40 euros were worth $45. Enter an equation of the form y = kx to show the relationshi
Nataliya [291]

Answer:  y = 1.125x  

Step-by-step explanation:

Divide the amount in dollars by the number of euros.

9/8 = 1.125

45/40 = 1.125

Since the constant change is 1.125, the input the  1.125 into the formula y=kx for k  to get the equation   y = 1.125x  

3 0
3 years ago
Other questions:
  • What is 4/5 x 15=? Please help
    9·2 answers
  • What’s the radius of a circle (x+2)^2 + (y-5)^2=9
    15·1 answer
  • 23. if you throw a dart and it hits within the larger circle, what is the probability that it will not hit the smaller circle?
    12·1 answer
  • Thrice of product of five and b is reduced by 2
    11·1 answer
  • 8-x&lt;5 solve the inequality and graph the solution
    12·1 answer
  • Find the sum of 5(-3.4k -7) + (3k +12) and please show work
    5·1 answer
  • 3(77/2-5/2y)+7y=111<br> the answer should be 9 but i don’t know the steps to get to it
    13·1 answer
  • What do you mean by a reference point? ​
    5·1 answer
  • Here!!!!!!!!!!!!!!<br><br>For Kawaii cos 2007<br><br><br>(it needs more words lol.)
    14·2 answers
  • 8m - 8 - 8 = 16<br> equation
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!