/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[ ][ thestack new stackx()/end constructor /public void addvertex(char labvertexlist[nverts++new vertex(lab)/public void addedge(int startint endadjmat[start][end adjmat[end][start /public void displayvertex(int vsystem out print(vertexlist[vlabel)/public void mst(/minimum spanning tree (depth first/start at vertexlist[ wasvisited true/mark it thestack push( )/push it while!thestack isempty(/until stack empty /get stack top int currentvertex thestack peek()/get next unvisited neighbor int getadjunvisitedvertex(currentvertex)if( =- /if no more neighbors thestack pop()/pop it away else /got neighbor