[SOLVED] CECS328-Lab 8

20.99 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

Rate this product

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.
Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.