listing continued vertexlist[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 dfs(/depth-first search /begin at vertex vertexlist[ wasvisited true/mark it displayvertex( )/display it thestack push( )/push it while!thestack isempty(/until stack empty/get an unvisited vertex adjacent to stack top int getadjunvisitedvertexthestack peek()if( =- /if no such vertexthestack pop()else /if it existsvertexlist[vwasvisited true/mark it displayvertex( )/display it thestack push( )/push it /end while /stack is emptyso we're done for(int = <nvertsj++/reset flags vertexlist[jwasvisited false/end dfs //returns an unvisited vertex adj to