Question

1. (5 pts) Perform topological sorting on the directed graph below. Show two orderings that can result, such that no letter is in the same position in each ordering: e.g., D cannot be in the 3rd position in both orderings; if the algorithm does not finish, show the part of the graph that remains unprocessed (and explain why it remains unprocessed). Order 1 Order 2

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Topology Sort


Step   Visited       Sorted

10      I             D
9       D             I    
8       H            H
7       C             J
6       F             A
5       A             F
4       G             C
3       B             E
2       E             G
1       J             B


PoP From Up to Down From Sorted Stack

So Sorted List for order 1 is --> D I H J A F C E G B


Step         Visited      Sorted

10               H           H
9               E           D
8               J           J
7               D           E         
6               A           I
5               I           A
4               B           F
3               G           G
2               F           B             
1               C           C

PoP From Up to Down From Sorted Stack

So Sorted List for order 2 is --> H D J E I A F G B C        


Add a comment
Know the answer?
Add Answer to:
1. (5 pts) Perform topological sorting on the directed graph below. Show two orderings that can...
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
ADVERTISEMENT