Microsoft interview question

Write and explain the union find algorithm.