Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. public class Example {
  2.  
  3.   public Example(int N) // create N-by-N grid, with all sites blocked
  4.   {
  5.     uf = new WeightedQuickUnionUF(N);
  6.   }
  7.  
  8.   public void foo(int i)
  9.   {
  10.     uf.union(i,i);
  11.   }
  12.  
  13.   private WeightedQuickUnionUF uf;
  14.  
  15.   public static void main(String[] args)   // test client (optional)
  16.   {
  17.     Example ex = new Example(5);
  18.     ex.foo(5);
  19.   }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement