Question

Which of the following is TRUE about Topological Sorting? Topological Sort can be used as a...

Which of the following is TRUE about Topological Sorting?

  1. Topological Sort can be used as a subroutine to find shortest paths in a weighted DAG in time O(V+E); in particular, the time does not depend on the magnitudes of the weights on the edges, and the weights on the edges may be negative.
  2. A Topological Sort algorithm sorts the nodes of an arbitrary directed graph G in an order that is consistent with all the paths in G, that is if there is a path from u to v in G then u precedes v in the resulting sorted list.
  3. Topological Sort sorts an array of numbers of length n in time O(n).
  4. When Topological Sort is used to find shortest paths in a weighted DAG, no relaxation steps are necessary.
  5. Topological Sort of a DAG can be implemented easily using DFS in time O(V+E), based on the times when the nodes in the DAG are first encountered in the DFS.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Topological Sort of a DAG can be implemented easily using DFS in time O(V+E), based on the times when the nodes in the DAG are first encountered in the DFS.

Add a comment
Know the answer?
Add Answer to:
Which of the following is TRUE about Topological Sorting? Topological Sort can be used as a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT