union(a, b) {
    const aRoot = this.find(a);
    const bRoot = this.find(b);

    if (aRoot === bRoot) return;

    if (this.heights[aRoot] > this.heights[bRoot]) {
      this.roots[bRoot] = aRoot;
    } else if (this.heights[aRoot] < this.heights[bRoot]) {
      this.roots[aRoot] = bRoot;
    } else {
      this.roots[bRoot] = aRoot;
      this.heights[aRoot] += 1;
    }
  }
Joins the `a` and `b` nodes into same set.
@param {number} a
@param {number} b
@returns {number}