I learned Red Black Tree at begining of this semster.
It is my favourite data structure!
Here are four steps of RBT insert.
- 1. Start with BST insert algorithm, inserting red nodes.
- 2. While property could be violated by doing this?
- 3. Use algorithm to repair such violations when the occur.
- 4. Set root node to black.
Here is an image:
![](https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Red-black_tree_example_with_NIL.svg/474px-Red-black_tree_example_with_NIL.svg.png)
Here is a link: Wiki Red Black Tree