Write BFS algorithm

  1. Initialize the first node’s dist number and place in queue
  2. Repeat until all nodes have been examined
  3. Remove current node to be examined from queue
  4. Find all unlabeled nodes adjacent to current node
  5. If this is an unvisited node label it and add it to the queue
  6. Finished.

Discover more from Soa Technology | Aditya Website Development Designing Company

Subscribe to get the latest posts sent to your email.



Leave a Reply

Discover more from Soa Technology | Aditya Website Development Designing Company

Subscribe now to keep reading and get access to the full archive.

Continue reading