In this map
example:
std::map<int, int> m;
for (int i = 0; i < 1000; i++)
m[2*i] = i;
for (i = 0; i < 1000; i++) // just an example of filling a map
m[2*i + 1] = i;
how to know how the internal "red-black tree" will look like?
Which nodes will be a child of which other nodes?
Understanding this (visually) in such a simple example, would allow me to grasp better how the red-black tree map implementation work.
I read many answers such as Why is std::map implemented as a red-black tree? about implementation of std::map
as a red-black tree, but it didn't help. I also read Red–black tree, but again, a simple example in the case of a map would help to understand how it works.