q01VertexOrder
solutions.q01VertexOrder
Question 1
Given the following undirected graph, perform a BFS as well as DFS starting from vertex \(A\). List the order in which the vertices are visited.
\(\{A-B,\; A-C,\; B-D,\; C-D,\; D-E\}\)
Functions:
Name | Description |
---|---|
q01VertexOrder |
Args: |
q01VertexOrder(G)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
G
|
Graph
|
Graph resolves into |
required |
Using BFS
Write your comment here.
Using DFS
Write your comment here.