union find algorithm
Merge pull request #421 from girishramnani/master

union find algorithm