/else no actionjust leave the old vertex there /end if else /no edge with same destination vertex /so insert new one edge theedge new edge(currentvertnewvertnewdist)thepq insert(theedge)/end putinpq(//end class graph ///////////////////////////////////////////////////////////////class mstwapp public static void main(string[argsgraph thegraph new graph()thegraph addvertex(' ')/ (start for mstthegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addedge( )/ab thegraph addedge( )/ad thegraph addedge( )/bc thegraph addedge( )/bd thegraph addedge( )/be thegraph addedge( )/cd thegraph addedge( )/ce thegraph addedge( )/cf thegraph addedge( )/de thegraph addedge( )/ef system out print("minimum spanning tree")thegraph mstw()/minimum spanning tree system out println()/end main(/end class mstwapp //////////////////////////////////////////////////////////////the main(routine in class mstwapp creates the tree in figure here' the outputminimum spanning treead ab be ec cf the shortest-path problem