Graph专题
文章平均质量分 89
zhaobaoxue
这个作者很懒,什么都没留下…
展开
-
DFS Search with Path Recording
Search solution using dfs while recording the current paths from the root to the current node.原创 2014-09-05 20:58:21 · 462 阅读 · 0 评论 -
Clone Graph
用一个map(unordered_map)保存原始node和新node的对应关系。转载 2014-05-29 16:42:53 · 441 阅读 · 0 评论 -
Graph Traversal (BFS vs DFS vs Stack)
BFS template: (from wiki) 1 procedure BFS(G,v) is 2 create a queue Q 3 create a set V 4 add v to V 5 enqueue v onto Q 6 while Q is not empty loop 7 t ← Q.dequeue()转载 2014-09-11 15:56:18 · 787 阅读 · 0 评论