listing continued public void mstw(currentvert /minimum spanning tree /start at while(ntree nverts- /while not all verts in tree /put currentvert in tree vertexlist[currentvertisintree truentree++/insert edges adjacent to currentvert into pq for(int = <nvertsj++/for each vertexif( ==currentvert/skip if it' us continueif(vertexlist[jisintree/skip if in the tree continueint distance adjmat[currentvert][ ]ifdistance =infinity/skip if no edge continueputinpq(jdistance)/put it in pq (maybeif(thepq size()== /no vertices in pqsystem out println(graph not connected")return/remove edge with minimum distancefrom pq edge theedge thepq removemin()int sourcevert theedge srcvertcurrentvert theedge destvert/display edge from source to current system out printvertexlist[sourcevertlabel )system out printvertexlist[currentvertlabel )system out print(")/end while(not all verts in tree/mst is complete for(int = <nvertsj++/unmark vertices vertexlist[jisintree false/end mstw