weighted graphs listing continued /public void putinpq(int newvertint newdist/is there another edge with the same destination vertexint queueindex thepq find(newvert)if(queueindex !- /got edge' index edge tempedge thepq peekn(queueindex)/get edge int olddist tempedge distanceif(olddist newdist/if new edge shorterthepq removen(queueindex)/remove old edge edge theedge new edge(currentvertnewvertnewdist)thepq insert(theedge)/insert new edge /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( )thegraph addedge( )/ab /ad