Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Example {
- public Example(int N) // create N-by-N grid, with all sites blocked
- {
- uf = new WeightedQuickUnionUF(N);
- }
- public void foo(int i)
- {
- uf.union(i,i);
- }
- private WeightedQuickUnionUF uf;
- public static void main(String[] args) // test client (optional)
- {
- Example ex = new Example(5);
- ex.foo(5);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement