with the column number (the array indexof the entry with the minimum distance public int getmin(/get entry from spath /with minimum distance int mindist infinity/assume large minimum int indexmin for(int = <nvertsj++/for each vertex/if it' in tree and if!vertexlist[jisintree &/smaller than old one spath[jdistance mindist mindist spath[jdistanceindexmin /update minimum /end for return indexmin/return index of minimum /end getmin(we could have used priority queue as the basis for the shortest-path algorithmas we did in the last section to find the minimum spanning tree if we hadthe getmin(method would not have been necessarythe minimum-weight edge would have appeared automatically at the front of the queue howeverthe array approach shown makes it easier to see what' going on updating spath[with adjust_spath(the adjust_spath(method is used to update the spath[entries to reflect new information obtained from the vertex just inserted in the tree when this routine is calledcurrentvert has just been placed in the treeand starttocurrent is the current entry in spath[for this vertex the adjust_spath(method now examines each vertex entry in spath[]using the loop counter column to point to each vertex in turn for each spath[entryprovided the vertex is not in the treeit does three things it adds the distance to the current vertex (already calculated and now in starttocurrentto the edge distance from currentvert to the column vertex we call the result starttofringe it compares starttofringe with the current entry in spath[ if starttofringe is lessit replaces the entry in spath[this is the heart of dijkstra' algorithm it keeps spath[updated with the shortest distances to all the vertices that are currently known here' the code for adjust_spath()public void adjust_spath(/adjust values in shortest-path array spath int column /skip starting vertex while(column nverts/go across columns /if this column' vertex already in treeskip it