Click here to Skip to main content
15,947,958 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Introduction to Graph with Breadth First Search(BFS) and Depth First Search(DFS) Traversal Implemented in C++

[edit]DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously. - OriginalGriff[/edit]
Updated 24-Jun-11 3:21am

If you are going to post your homework, at least try to make it look like you have attempted to do something yourself!

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, or learn the Magic Words: "Do you want fries with that?"
Share this answer
Sergey Alexandrovich Kryukov 24-Jun-11 23:50pm    
A 5 for telling all that, but... come on, what fries?
Did you notice the notion also makes no sense? Please see my answer.
OriginalGriff 25-Jun-11 3:47am    
This is Q&A! Half the questions make no sense... :laugh:
Sergey Alexandrovich Kryukov 25-Jun-11 17:25pm    
Half? You're such an optimist! :-)
If you think a bit you would clearly see that those algorithms are inapplicable for a general graph by at least one simple reason: for such a graph there is no way to tell the width from breadth. :-) The algorithms are only applicable to the special case of graph called "tree" when the root node is given. Tree is defined as a graph without cycle. Unlike many graph problems, this search is absolutely trivial, but it could not do anything without at least reading of the basic definitions.

Share this answer
Espen Harlinn 25-Jun-11 11:19am    
A5 ;-)
Sergey Alexandrovich Kryukov 25-Jun-11 17:24pm    
Thank you, Espen.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900