Question

PI) Given undirected graph answer the following questions: (30 points) (a) Show how a Breath-First Search (BFS) works. Your s
0 0
Add a comment Improve this question Transcribed image text
Answer #1

hello dear,

to solve this question we will go one by one.

A. BFS:

to solve in BFS, there is three-step:

1. visiting a vertex in any order.

2. exploration of the vertex.

3. repeat the above step to reach all vertex.

in BFS, I have traversed all vertex, In BFS, we always take a queue.

Queue: Balten 51 x D FU DES - BAHCI GFDEL

B. DFS:

to solve in BFS, there is fouth-step:

1. visiting the first vertex which can be exploring further vertex.

2. exploration of the vertex.

3. further don't have to explore anything vertex then come back and traverse left vertex by backward.

4. repeat the above step to reach all vertex.

in DFS, we always take a stack to traverse all vertex.

DFS LO In this method we have different apporach to solve it. Here all vertex is connected, So, we can easily traverse in my

you are asking for discovery time and return time. which is not possible because it undirected graph and doesn't have weights value to wait we can take value in alphabetical form but we have to direct graph because when it will undirected graph then we can traverse anywhere. if anywhere asking about this then just write vertex value which you are processing.

thanks you.

Add a comment
Know the answer?
Add Answer to:
PI) Given undirected graph answer the following questions: (30 points) (a) Show how a Breath-First Search...
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