It is about how the bfs and dfs works and what all procedures or steps to follow with the given pesudo in the last slide
Size: 243.44 KB
Language: en
Added: Mar 12, 2025
Slides: 4 pages
Slide Content
S N N N C S S P BFS
All the nodes will be covered in a very few depths Number of nodes and depth of the tree and Branching 1000 10 Admissible True Cost Path Cost Heuristic Greedy A* UCS DFS BFS
BFS Ans Que 1 2 4 3 5 8 7 10 9 6 BFS Ans Que 1 4 2 3 5 8 7 10 9 6 DFS Ans STACK 1 4 3 10 9 2 5 6 8 7
BFS Ans Que 1 2 4 3 5 8 7 10 9 6 Function Rishi Node = read( tree.node ) If node is null return End if i =0 J= 0 Que[ i ] = node While i <= node.count If node has neighbours then que[ i ] = null ans [ i ] = node for k = 1 to neighbour.node.count j=1 + 1 Que[j] = neighbours.node [k] Rishi(que[j]; next else End if i = i + 1 loop