EL9343 Homework 8 solution

$30.00

Original Work ?

Download Details:

  • Name: Homework-08-vo0dys.zip
  • Type: zip
  • Size: 393.47 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

1. What is the running time of DFS if the graph is given as an adjacency list and adjacency matrix? Justify
your running time.
2. Run DFS on the graph below, assume that DFS considers vertices in alphabetical order and the adjacency
lists are also alphabetical order. Show the discover times and finishing times of each vertex in the graph.
3. Write a method that takes any two nodes 𝑒 and 𝑣 in a tree 𝑇, and quickly determines if the node 𝑒 in the
tree is a π‘‘π‘’π‘ π‘π‘’π‘›π‘‘π‘Žπ‘›π‘‘ or π‘Žπ‘›π‘π‘’π‘ π‘‘π‘œπ‘Ÿ of node 𝑣
4. Draw the parenthesis structure of the dfs of Figure 1 (start from u, assume that DFS considers vertices in
alphabetical order) and see the example parenthesis structure as Figure 2.
Figure 1 Figure 2