// Source code example for "A Practical Introduction // to Data Structures and Algorithm Analysis" // by Clifford A. Shaffer, Prentice Hall, 1998. // Copyright 1998 by Clifford A. Shaffer class Graphm implements Graph { // Graph: Adjacency matrix private int[][] matrix; // The edge matrix private int numEdge; // Number of edges public int[] Mark; // The mark array public Graphm(int n) { // Constructor Mark = new int[n]; matrix = new int[n][n]; numEdge = 0; } public int n() { return Mark.length; } // Number of vertices public int e() { return numEdge; } // Number of edges public Edge first(int v) { // Get the first edge for a vertex for (int i=0; i