Red Black Tree
β Red Black Tree
self balancing BST
colors all nodes in red or black
to maintain balance during insertions, deletions
- root is always black
- maintains the connected nodes not to repeat color
- red node has black children
- every path from a node to its descendant null node has same number of black nodes
π AVL tree
- AVL tree: more balanced
- Red Black Tree: more effective for insertion and deletions(less roatation)
This post is licensed under CC BY 4.0 by the author.