[理工] 演算法 DFS
看板Grad-ProbAsk作者Murasaki0110 (Paradise Lost)時間13年前 (2012/06/16 23:15)推噓0(0推 0噓 0→)留言0則, 0人參與討論串1/2 (看更多)
Given as input a connected undirected graph G, a spanning tree T of G, and a
vertex v, design an algorithm to determine whether T is a valid DFS tree of G
rooted at v. In other words, determine whether T can be the ouput of DFS under
some order of the edges starting with v. The runnung time of the algorithm
should be O(|V|+|E|)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.45.27.36
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):