Initialization 

We will use two data structures:

  • visited: This contains all the vertices that have been visited. Initially, it will be empty. 
  • queue: This contains all the vertices that we have want to visit in next iterations.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.48.135