Assignment Chef icon Assignment Chef

[Solved] COMP2140 Lab6-Graphs

5.0 1 customer review Digital download

Digital download

$25.00

Availability
In stock
Checkout
One item

Need a hand?

Message us on WhatsApp for payment or download support.

WhatsApp QR code Open WhatsApp
To write code to compute the in-degree of every vertex and to print out the vertices visited in a depth-first traversal starting at Vertex 0, for an adjacency-list implementation of a directed graph. In-Degrees and a Depth-First Traversal Get a copy of GraphAL.java (an adjacency-list implementation). Get a copy of the graph file graph.txt which lists the number of vertices (5) and edges between them. Write the body of the method printIndegrees, which prints out the in-degree of each vertex in the graph. Also, write the body of the method recursiveTraversal, which performs a recursive depth-first traversal of the graph starting at the vertex given by parameter currVertex, printing out a vertex when the traversal visits it. The steps of a recursive depth-first traversal at currVertex: The intent is to see which vertices can be reached if you start at vertex 0, and what order you would visit them in.