Question 61
HardWhat is the output of this code?
from collections import deque
def ():
g = [[] _ (n)]; indeg = [] * n
a, b edges: g[a].append(b); indeg[b] +=
q = deque(i i (n) indeg[i] == ); out = []
q:
u = q.popleft(); out.append(u)
v g[u]:
indeg[v] -=
indeg[v] == : q.append(v)
out (out) == n
(topo(, [(, ), (, ), (, ), (, ), (, ), (, )]), topo(, [(, ), (, ), (, )]))