applications
Class UnionFindWithTrees

java.lang.Object
  |
  +--applications.UnionFindWithTrees

public class UnionFindWithTrees
extends java.lang.Object


Constructor Summary
UnionFindWithTrees(int n)
          initialize n trees, one element per tree/class/set
 
Method Summary
 int find(int theElement)
           
static void main(java.lang.String[] args)
          test program
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnionFindWithTrees

public UnionFindWithTrees(int n)
initialize n trees, one element per tree/class/set
Method Detail

find

public int find(int theElement)
Returns:
root of the tree that contains theElement

main

public static void main(java.lang.String[] args)
test program