Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0063775

Browse files
committed
Fix in quick union
1 parent 9d89993 commit 0063775

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/graphs/searching/weightquickunion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function QuickUnion(n) {
2323
*/
2424
QuickUnion.prototype._root = function (i) {
2525
while (i !== this._ids[i]) {
26-
// this._ids = this._ids[this._ids[i]]; //enables the path compression
26+
// this._ids[i] = this._ids[this._ids[i]]; //enables the path compression
2727
i = this._ids[i];
2828
}
2929
return i;

0 commit comments

Comments
 (0)