摘要:
ROUTE-COUNT(G) DFS(G) count = 0 return COUNT(G,s,t)COUNT(G,s,t) for each v in G:Adj[s] if v.d == t.d count = count + 1 else if v.d <t.d return count + COUNT(G,v,t) return count 阅读全文
摘要:
DFS(G) for each vertex u in G.V u.color = white u.pi = NIL time = 0 let A be a stack for each vertex u in G.V if u.color == white A.push(u) while A is not empty x = A.top() flag = 0 for each v in G:Adj[x] if v.color == white//遇到堆栈顶端元素相邻的节点有白色的都入栈 flag = 1 tim... 阅读全文