Apparently, you could do this, but the first is more common.
Why did you choose the latter and how does it work?
I read this: http://www.drdobbs.com/cpp/stls-red-black-trees/184410531 ; which made me think that they did it. It says:
insert_always is a state variable that tells rb_tree whether multiple instances of the same key value are allowed. This variable is set by the constructor and is used by STL to distinguish between multitude and multiset, as well as between map and multimap. set and map can have only one occurrence of a certain key, while multiset and multimap can have several occurrences.
Although now I think that this does not necessarily mean it. They can still use containers.
I think that all nodes with the same key should be in the row, because you either need to store all nodes with the same key on the right side or on the left side. Therefore, if you store equal nodes to the right and insert 1000 1 and 2, you will have basically a linked list that destroys the properties of red ebony.
Is there a reason why I canβt find a lot on it that this is just a bad idea?
source share