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.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.