Skip to content
Browse files

correct implementation of disjoint set ...

  • Loading branch information...
1 parent 460f87c commit 65171fd5730d0634a3f39e8084c64fb3a805285d @tianyicui committed Apr 19, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 liarliar/liarliar
View
2 liarliar/liarliar
@@ -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.
Something went wrong with that request. Please try again.