[SOLVED] CECS328-Lab8

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon lab8-ws61ud.zip (305.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
Rate this product

Programming assignment 8.

Note: you can have different names for vertices: {a b c d e ..} = {v1 v2 v3 v4 ..} = {1 2 3 4 ..}

 

In this program you are required to implement DFS.

First, you can create the below graphs and print the resulting adjacency matrices/lists. Or create a random graph.

 

  1. Run DFS function to check if the graph is a DAG (directed acyclic graph):
    • Search for backward edges. If there are any, print: β€œCycle detected, topological sort is impossible”.
  2. If the graph is DAG, (while running DFS):
    • Insert the vertex into a linked list as it finishes.
    • Using your linked list, print the topological order of the vertices along with their start/finish time.
  • lab8-ws61ud.zip