GRAPH PRIMS ALGORITHM #include < stdio.h > int findParent ( int parent [] , int i ) { if (parent[i] == i) { retur…