The document discusses breadth first traversal and depth first traversal in graphs. It provides an example of a graph with 4 nodes and asks the user to input the adjacent matrix. It then performs BFS and DFS on the graph, outputting the order that the nodes are visited for each traversal method. BFS visits the nodes in order of 1, 2, 3, 4 while DFS visits them in the order of 1, 3, 2, 4.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online from Scribd
The document discusses breadth first traversal and depth first traversal in graphs. It provides an example of a graph with 4 nodes and asks the user to input the adjacent matrix. It then performs BFS and DFS on the graph, outputting the order that the nodes are visited for each traversal method. BFS visits the nodes in order of 1, 2, 3, 4 while DFS visits them in the order of 1, 3, 2, 4.
The document discusses breadth first traversal and depth first traversal in graphs. It provides an example of a graph with 4 nodes and asks the user to input the adjacent matrix. It then performs BFS and DFS on the graph, outputting the order that the nodes are visited for each traversal method. BFS visits the nodes in order of 1, 2, 3, 4 while DFS visits them in the order of 1, 3, 2, 4.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online from Scribd
The document discusses breadth first traversal and depth first traversal in graphs. It provides an example of a graph with 4 nodes and asks the user to input the adjacent matrix. It then performs BFS and DFS on the graph, outputting the order that the nodes are visited for each traversal method. BFS visits the nodes in order of 1, 2, 3, 4 while DFS visits them in the order of 1, 3, 2, 4.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online from Scribd