graphs graphn workshop applet repeatedly clicking the tree button in the graphn workshop algorithm will create minimum spanning tree for any graph you create try it out with various graphs you'll see that the algorithm follows the same steps as when using the dfs button to do search when you use treehoweverthe appropriate edge is darkened when the algorithm assigns it to the minimum spanning tree when the algorithm is finishedthe applet removes all the non-darkened linesleaving only the minimum spanning tree final button press restores the original graphin case you want to use it again java code for the minimum spanning tree here' the code for the mst(methodwhile!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 vertexlist[vwasvisited true/mark it thestack push( )/push it /display edge displayvertex(currentvertex)/from currentv displayvertex( )/to system out print(")/end while(stack not empty/stack is emptyso we're done for(int = <nvertsj++/reset flags vertexlist[jwasvisited false/end mst(as you can seethis code is very similar to dfs(in the else statementhoweverthe current vertex and its next unvisited neighbor are displayed these two vertices define the edge that the algorithm is currently traveling to get to new vertexand it' these edges that make up the minimum spanning tree in the main(part of the mst java programwe create graph by using these statements