2013年9月16日

摘要: 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 阅读全文
posted @ 2013-09-16 22:29 程序猿猿猿 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2013-09-16 15:48 程序猿猿猿 阅读(1733) 评论(0) 推荐(0) 编辑

导航