successors /(or - if no such vertsboolean isedge/edge from row to column in adjmat for(int row= row<nvertsrow++/for each vertexisedge false/check edges for(int col= col<nvertscol++ifadjmat[row][col /if edge to /anotherisedge truebreak/this vertex /has successor /try another if!isedge /if no edgesreturn row/has no successors return - /no such vertex /end nosuccessors(/public void deletevertex(int delvertif(delvert !nverts- /if not last vertex/delete from vertexlist for(int =delvertj<nverts- ++vertexlist[jvertexlist[ + ]/delete row from adjmat for(int row=delvertrow<nverts- row++moverowup(rownverts)/delete col from adjmat for(int col=delvertcol<nverts- col++movecolleft(colnverts- )nverts--/one less vertex /end deletevertex /private void moverowup(int rowint lengthfor(int col= col<lengthcol++adjmat[row][coladjmat[row+ ][col]/private void movecolleft(int colint lengthfor(int row= row<lengthrow++