Adding union-find implementations from chapter 1.5