q will store the vertices that have indegree equal to zero
q = [ ] NEW_LINE for i in range ( n ) : NEW_LINE INDENT if ( indeg [ i ] == 0 ) : NEW_LINE INDENT q . append ( i ) NEW_LINE visited [ i ] = True NEW_LINE DEDENT DEDENT