closes #2

Taken from an implementation I did

```js
// weighted quick union
function Findable(n) {
    this.components = n;
    this.sizes = [];
    this.items = [];

    // fill
    for (var i = 0; i < n; i++) {
        this.sizes[i] = 1;
        this.items[i] = i;
    }
}

Findable.prototype.union = function (p, q) {
    var pf = this.find(p);
    var qf = this.find(q);
    if (pf == qf) return this; // already linked
    var psz = this.sizes[qf];
    var qsz = this.sizes[pf];

    if (psz < qsz) {
        this.items[pf] = qf;
        this.sizes[qf] += psz;
    } else {
        this.items[qf] = pf;
        this.sizes[pf] += qsz;
    }
    this.components--;
    return this;
};

Findable.prototype.find = function (p) {
    // walk up the tree
    while (p != this.items[p]) {
        p = this.items[p];
    }
    return p;
};

Findable.prototype.connected = function (p, q) {
    // share same parent node
    return this.find(p) === this.find(q);
};

// now a quick demo
var finder = new Findable(10);

var input = "4-2 1-0 2-0 5-7 6-2 7-3 7-9 9-8 8-1";
input = input.split(' ').map(function (v) {
    return v.split('-').map(function (v) {
        return parseInt(v);
    });
});

input.forEach(function (pair) {
    finder.union(pair[0], pair[1]);
});

console.log(finder.items.join(' '));
```