On Wed, Jul 5, 2017 at 1:46 PM, jacobus erps <jacobus.erps@xxxxxxxxx> wrote:
So we *shouldn't* mutate the keys, but what if we do anyway? Can the
tree become corrupted?

I think it's just like using a Java Map.
You can put any object in it as key as long as it supports the compareTo
method (defined at Object).

When you add a key/item pair the key will be inserted inbetween the other
keys in the right order.
This order won't change; it's fixed.
So if you change the key in some way which affects the sorting order, the
sorting order won't reflect the position in the map. So yes, then it's
corrupt. You just should not do that, the same with Java.

Wow. Really? I didn't expect that Java would let you do that. I don't
know Java very well, but I thought it was supposed to be a very "safe"

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.