
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

final static int BAD=0; final static int TREE=1;
class Node { int ID; int dfsNum; boolean visited; String nodeLabel; EdgeList adj; // pointer to head of linked list of successors public String toString() { return ID + nodeLabel ; } } class EdgeList { EdgeList next; Edge e; }
class Edge { int from; // endpoint of start node int to; // endpoint of end node double len; // length of edge in graph (or cost or other annotation) int edgeType: {TREE BAD} Edge( int f, int t, double l) { from = f; to = t; len =l;}
public class Graph{
final static int SIZE = 20; Node [] nodes = new Node[ SIZE ];
(1) Label all nodes with dfs number (in sequential order)
(2) Label all edges with the type of edge it is