Question

Explain The Steps Involved In The ( BFS ) Strategy note : Explain more details and...

Explain The Steps Involved In The ( BFS ) Strategy

note : Explain more details and clear because this question 8 Marks  

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

BFS which is known as breadth first search strategy

It is search strategy where root node is explored/visited first, then all their successor nodes of root are visited, then thier successor and so on until the goal node is found

All the nodes at a given depth in the search tree is explored before a node in the next depth is explored

It ensures that all nodes are covered are visited or not

It first traverse to children nodes and then grand children's node

Algorithm

Step 1:set status =1(ready state)

For each node in G (graph)

Step 2:enqueue the starting node

And set it's status=2(waiting state)

Step 3: repeat step 3,4 until the queue is empty

Step4: Dequeue a node N.process it and set it's status=3(processed state)

Step5:Enqueue all the neighbouring of N that are in ready state

Whose status is 1 and set thier status =2

(Waiting state)

[End of loop]

Step 6:Exit

Let us take an exmple

Add a comment
Know the answer?
Add Answer to:
Explain The Steps Involved In The ( BFS ) Strategy note : Explain more details and...
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