- Now the goal is to perform efficient percolates() queries (boolean method that checks whether system percolates or not), using the UnionFind algorithm (Brute-force solution will take quadratic time, which is not scalable for huge systems).
Additional materials that might be useful:
Now the goal is to perform efficient percolates() queries (boolean method that checks whether system percolates or not), using the UnionFind algorithm (Brute-force solution will take quadratic time, which is not scalableQuick video for huge systems).visualizing the entire process:
https://www.youtube.com/watch?v=xUWuZjadbbQQuick video for visualizing the entire process:
https://www.youtube.com/watch?v=xUWuZjadbbQ Source code for WeightedQuickUnionUF: http://algs4.cs.princeton.edu/15uf/WeightedQuickUnionUF.java.html