Permalink
Browse files

correct implementation of disjoint set ...

  • Loading branch information...
tianyicui committed Apr 19, 2011
1 parent 460f87c commit 65171fd5730d0634a3f39e8084c64fb3a805285d
Showing with 1 addition and 1 deletion.
  1. +1 −1 liarliar/liarliar
View
@@ -8,7 +8,7 @@ D = (0...2*n).to_a
def find x
y = D[x]
- x == y ? x : find(y)
+ x == y ? x : D[x] = find(y)
end
def join x, y

0 comments on commit 65171fd

Please sign in to comment.