Reputation: 43
Can someone show me a step by step tutorial on how to insert numbers 1-10 in a Red-black tree?
I already tried doing so but I seem to be failing
*by insert I mean adding 1,2,3,4,5,6,7,8,9,10 in an initially empty rbt. thanks!
Upvotes: 1
Views: 2000
Reputation: 76366
It depends on what you mean by " insert numbers 1-10 in a Red-black tree":
If you mean a legal tree obtained from these values, you can build a red-black tree from an ordered vector in linear time.
If you mean a visualization of 10 insert operations, you can try here.
Upvotes: 3