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:
Here is a link: Wiki Red Black Tree