Convert this c++ code to c language #include using namespace std; //FIND(X) int find(int X, vector& parent) { if (parent[X] == X) return X; return find(parent[X], parent); } //UNION(X,Y) void UNION(int X, int Y, vector& parent) { parent[Y] = X; } int main() { int n, m; cout << "Enter number of edges\n"; cin >> n; cout << "Enter number of nodes\n"; cin >> m; //edges list //each edge is a vector [u,v] vector > edges(n); for (int i = 0; i < n; i++) { int u, v; cout << "info for edge " << i + 1 << endl; cout << "Enter source node u: "; cin >> u; cout << "Enter destination node v: "; cin >> v; edges[i] = vector{ u, v }; } vector parent(m + 1); for (int i = 1; i <= m; i++) parent[i] = i; for (auto edge : edges) { //find set name for source node, u int x = find(edge[0], parent); //cout<
Convert this c++ code to c language
#include <bits/stdc++.h> using namespace std; //FIND(X) int find(int X,
Step by step
Solved in 4 steps