Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

visited [ 1 - - n ] = 0 ; finished [ 1 - n ] = 0 ; out 1 - - n ;

visited [1--n]=0; finished [1-n]=0; out 1--n; stage [1-n]=1;
for i=1 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 g@(i)
go(i)
visited [i]=1;for 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;
else go(j)
ifgo(j)
stage [i]stage[j]
finished [i]=1
this pseudo code for the topological sort algorithm i need to compute it as a simple C code using the exact functions in the code above . And i need the explanation of it line by line please
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions