6.2 BFS and DFS Graph Traversals| Breadth First Search and
Depth First Search | Data structures
Jenny's Lectures CS IT
BFS means breadth-first search or sometimes it is also known as level order traversal and the
DFS s depth-first. search fine so we 'll take this example and with the help of this example I am
going to discuss with you the BFS traversal fine in BFS. When you will start then you can take
any node as a root node you can start traversing this graph from any node. One would be
deleted and what one would be printed means one go how many delete kill the edit one has all
has already been visited. Next is next is next element in queue is one now one has been deleted.
One would not be inserted and after that 3 you can insert three or one in any order. In BFS queue
data structure is used and as in DFS what data structure will be used that is stuck and it works
only for minute last in first out. In DFS also you can take any node as root node and you can
start traversing from that node. DFS means depth first search traversal of this graph.
Depth-first search MATLAB you 'll go deeper and deeper until a dead end dead end. You would
take any vertices unvisited vertices and push that vertices into this stack up to village therefore
be less active suppose you have taken two to go up in a print. Aha corner first step is five would
be popped out from the stack ticket the top element would be. The topmost element is deleted
popped out then six would be pumped out six poo powder Shugar. The next top element is for a
visa package elegantly from six you would go to which element this four element then backtrack
to four. AHA pay only three so to say backtrack AHA. Check out is there any animated vertices
adjacent of two and still unvisited no one is there okay then pop out this two now next s 3.
Check the next top element that is two then five say backtracking ca n't be hanging to the two.
Depth First Search | Data structures
Jenny's Lectures CS IT
BFS means breadth-first search or sometimes it is also known as level order traversal and the
DFS s depth-first. search fine so we 'll take this example and with the help of this example I am
going to discuss with you the BFS traversal fine in BFS. When you will start then you can take
any node as a root node you can start traversing this graph from any node. One would be
deleted and what one would be printed means one go how many delete kill the edit one has all
has already been visited. Next is next is next element in queue is one now one has been deleted.
One would not be inserted and after that 3 you can insert three or one in any order. In BFS queue
data structure is used and as in DFS what data structure will be used that is stuck and it works
only for minute last in first out. In DFS also you can take any node as root node and you can
start traversing from that node. DFS means depth first search traversal of this graph.
Depth-first search MATLAB you 'll go deeper and deeper until a dead end dead end. You would
take any vertices unvisited vertices and push that vertices into this stack up to village therefore
be less active suppose you have taken two to go up in a print. Aha corner first step is five would
be popped out from the stack ticket the top element would be. The topmost element is deleted
popped out then six would be pumped out six poo powder Shugar. The next top element is for a
visa package elegantly from six you would go to which element this four element then backtrack
to four. AHA pay only three so to say backtrack AHA. Check out is there any animated vertices
adjacent of two and still unvisited no one is there okay then pop out this two now next s 3.
Check the next top element that is two then five say backtracking ca n't be hanging to the two.