Question

Suppose G (V. E) is a directed graph represented by a adjacency lists. Divise a linear time algorithm that, given such a G, returns a list of all the source vertices of G. (Note, this list may be empty.) Prove your algorithm runs in O(|V|+|E|)-time.
Hint: There is a simple solution that does not involve any DFS’s or BFS’s.

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


ho have o boreok, clown the total Hme o (e) ond Rlalze o(ivi) Dequeve Ond output vaner- Ou Reduce n-do ofie Total Hrne - o (i

Add a comment
Know the answer?
Add Answer to:
Suppose is a directed graph represented by a adjacency lists. Divise a linear time algorithm that,...
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