Graph to tree for breadth and depth first search tree
Not what you're looking for?
Hi. We have been asked to do the following with a given graph (will be uploaded "cgraph.jpg")
1. Depth first tree
2. Breath first tree
I know now do to a depth first search and breath first search, but not a tree (I don't even know what it is asking). I'm assuming we are to somehow put it in tree form.
(This is to be written on paper, not used in program).
These are my results from the
depth first search: ABCDEF
breath first search: ABFCDE
I didn't post my steps however I know depth first uses stack and breath first uses queue.
I just need to be shown how to make them "trees" (on paper).
Purchase this Solution
Solution Summary
This problem describes on paper how to convert a graph into a tree, and search breadth first and depth first.
Solution Preview
To convert the given graph into a tree, you cut links C to F and C to E (see attachment).
For Breadth search, traverse left to right at every level.
For given problem:
Level 1: A
Level 2: left: B, right : F
Level 3: C
Level ...
Education
- BEng, Allahabad University, India
- MSc , Pune University, India
- PhD (IP), Pune University, India
Recent Feedback
- " In question 2, you incorrectly add in the $3.00 dividend that was just paid to determine the value of the stock price using the dividend discount model. In question 4 response, it should have also been recognized that dividend discount models are not useful if any of the parameters used in the model are inaccurate. "
- "feedback: fail to recognize the operating cash flow will not begin until the end of year 3."
- "Answer was correct"
- "Great thanks"
- "Perfect solution..thank you"
Purchase this Solution
Free BrainMass Quizzes
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.
Word 2010: Table of Contents
Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.
Inserting and deleting in a linked list
This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.
Excel Introductory Quiz
This quiz tests your knowledge of basics of MS-Excel.
Javscript Basics
Quiz on basics of javascript programming language.