listing graphs continued private vertex vertexlist[]/list of vertices private int adjmat[][]/adjacency matrix private int nverts/current number of vertices private char sortedarray[]/public graph(/constructor vertexlist new vertex[max_verts]/adjacency matrix adjmat new int[max_verts][max_verts]nverts for(int = <max_vertsj++/set adjacency for(int = <max_vertsk++/matrix to adjmat[ ][ sortedarray new char[max_verts]/sorted vert labels /end constructor /public void addvertex(char labvertexlist[nverts++new vertex(lab)/public void addedge(int startint endadjmat[start][end /public void displayvertex(int vsystem out print(vertexlist[vlabel)/public void topo(/topological sort int orig_nverts nverts/remember how many verts while(nverts /while vertices remain/get vertex with no successorsor - int currentvertex nosuccessors()if(currentvertex =- /must be cycle