New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RedBlack fails to rebalance or recolor in delete #2849
Comments
Imported From: https://issues.scala-lang.org/browse/SI-2849?orig=1
|
Florian Hars (florian) said: |
@dcsobral said: |
@dcsobral said: |
@lindydonna said: |
@axel22 said:
Not at all :) I'll check it out! |
Terry Woodruff (twoodruff) said: |
@dcsobral said: |
I suffer from a !StackOverflowError in !RedBlack when using an immutable !SortedSet (scala.collection.immutable.!TreeSet) in certain circumstances.
For example with this little test program:
This is the result in version 2.8.0.r20327-b20091231020112 on java "1.6.0_15"
The problem doesn't occur with simple additions to the set. The order of the operations in
aSortedSet = (aSortedSet - big) ++ (TreeSet(i, big - 1))
makes a difference.If you run this test through a debugger, and have a look at the structure of the actual tree, you'll see something like this (after 5 iterations):
In other words: an unbalanced tree, hence the !StackOverflowError.
The text was updated successfully, but these errors were encountered: