I am wondering what happens if you remove an object in the middle of a treemap. If the treemap would look something like this:
So what would happen if you remove the number 30? Because 27 and 34 will disconnect from the tree.
I think there are two cases here
TreeMap
) or just in general? The short answer is you have to reattach all the disconnected nodes. $\endgroup$java.util.TreeMap
, read about Red-Black trees and study the source code. $\endgroup$