Question: visited [ 1 - n ] = 0 ; finished [ 1 ] = 0 ; out 1 - - n ; stage [ 1

visited [1-n]=0; finished [1]=0; out 1--n; stage [1-n]=1;
for i=0 to n
for j1 to n
if G[i][j]=1
out [i]= out [i]+1;
for i=1 to n
if out [i]=0 then go(i)
go(i)
visited [i]=1;
Por j=1 to n
if G[j][i]=1
out [i]=out[i]+1;
for i=1 to n
if G[i][j]=1
if visited [j]=1
if finished =0
[end; cycle;
I need this in a simple c code that lets the user input the graph and then prints the graph after and before sorting it as a topological sort i need the same variables names and to use simple c functions
 visited [1-n]=0; finished [1]=0; out 1--n; stage [1-n]=1; for i=0 to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!