Class (weighted quick-union) from Week 1, Lecture 8.
Class (quick-union w/ path compression) from Week 1, Lecture 8.