摘要:
如果为undirected graph就是dfs或者bfs,如果都能visit则为连通O(V+E).如果为directed graph就先dfs或者bfs,再reverse direct,再dfs或者bfs,如果两次都连通则为strong connecthttp://www.geeksforgeek... 阅读全文
posted @ 2014-04-19 11:04
ying_vincent
阅读(196)
评论(0)
推荐(0)
摘要:
最小生成树算法。这里的s是可以随意选取的,不影响树的生成,但是不同的s有不同的dis 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; ... 阅读全文
posted @ 2014-04-19 07:24
ying_vincent
阅读(246)
评论(0)
推荐(0)
摘要:
geeks上的解答复杂了些,用回溯就行了 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 const int N = 5;1... 阅读全文
posted @ 2014-04-19 04:45
ying_vincent
阅读(237)
评论(0)
推荐(0)
摘要:
http://www.geeksforgeeks.org/suffix-array-set-1-introduction/http://www.geeksforgeeks.org/pattern-searching-set-8-suffix-tree-introduction/https://en.... 阅读全文
posted @ 2014-04-19 03:09
ying_vincent
阅读(122)
评论(0)
推荐(0)
浙公网安备 33010602011771号