algorithm - How to check if graph is connected using union find -
i need check if graph connected using union find algorithm. has one, can not use bfs or dfs, because need find minimal spanning tree using kruskal's algorithm if graph not connected, need return 0.
let's have this kruskal's algorithm using union find. there modification check if graph connected(we have 1 component)?
Comments
Post a Comment