you give connect undirected graph consist n vertex m edge the weight ith edge iHere wrong algorithm find minimum span tree mst graphvis array length n set edgesfunction dfsu visu true iterate edge u v order small large edge weight visv false add edge u v set s dfsvfunction findmstu reset element vis false reset edge set s dfsu return edge set sEach call findmst1 findmst2 findmstn gives span tree graph Determine tree minimum span tree