c語言中並查集的使用

使用並查集判斷一個圖是不是連通圖 1.源代碼以下web #include <cstdio> #include <vector> using namespace std; const int N =1111; vector <int> G[N]; int father[N] ; bool isRoot[N];//記錄每一個節點是否做爲某個集合的根節點 int findFather(int x
相關文章
相關標籤/搜索