listing graphs continued public int getadjunvisitedvertex(int vfor(int = <nvertsj++if(adjmat[ ][ ]== &vertexlist[jwasvisited==falsereturn jreturn - /end getadjunvisitedvertex(//end class graph ///////////////////////////////////////////////////////////////class dfsapp public static void main(string[argsgraph thegraph new graph()thegraph addvertex(' ')/ (start for dfsthegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )/ab /bc /ad /de system out print("visits")thegraph dfs()/depth-first search system out println()/end main(/end class dfsapp ///////////////////////////////////////////////////////////////depth-first search and game simulations depth-first searches are often used in simulations of games (and game-like situations in the real worldin typical game you can choose one of several possible actions each choice leads to further choiceseach of which leads to further choicesand so on into an ever-expanding tree-shaped graph of possibilities choice point corresponds to vertexand the specific choice taken corresponds to an edgewhich leads to another choice-point vertex