depth-first search is different from


Depth-first search is different from Breadth-first search in the following ways:

A depth search traversal method goes to the deepest level of the tree first and then works up whereas a breadth-first search looks at all possible paths at the similar depth before it goes to a deeper level. When we come to a dead end in a depth-first search, we back up as little as possible. We try another route from a new vertex-the route on top of our stack. In a breadth-first search, we require to back up as far as possible to find a route originating from the previous vertices. So the stack is not an appropriate structure for finding a previous route because it keeps track of things in the order opposite of their occurrence-the latest route is on top. To keep track of things in the order in which they happened, we use a FIFO queue.

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: depth-first search is different from
Reference No:- TGS0275311

Expected delivery within 24 Hours