Question: Convert the code from C++ to C #include #define int long long int #define pb push_back #define ps(x,y) fixed < x; while(x--) using namespace std3;

Convert the code from C++ to C
#include<bits/stdc++.h>#define int long long int #define pb push_back #define ps(x,y) fixed<<setprecision(y)<<x #define mod

res[0]=0; for(int i=1;i<v;i++) res[i] = -1; for(int i=0;i<v;i++) available[i] = false; int cn = 0; for(int i=1;i<v;i++){ for(

} }} cout<<cn<<endl; for(int i=0;i<v;i++) cout<<res[i]<<; }int32_t main() { solve(); return 0; }1:03 PM 

#include #define int long long int #define pb push_back #define ps(x,y) fixed < x; while(x--) using namespace std3; void solve(){ int v,e; cin>>v>>e; vector g(v); for(int i=0;i >x>>y; g[x].pb(y); gly).pb(x); } int res[v]; bool available[v];

Step by Step Solution

3.53 Rating (170 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

C Dynamic Memory As you know an array is a collection of a fixed number of values Once the size of an array is declared you cannot change it Sometimes ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Engineering Questions!