Properties of Red Black Trees

preview_player
Показать описание
In this video I walk through the properties of Red Black Trees. The properties of the trees are as follows: Every node is either red or black, ever leaf is black, the root node is always black, each of the paths from the root to the leaves have the same number of black nodes, no path from the root to the leaf has two consecutive red nodes, nodes are inserted in the same way, initially, as a binary search tree, and the tree is re-balanced by re-coloring.
Рекомендации по теме
Комментарии
Автор

Two thoughts:
1: Clip, however nice, often shows a state where it's not a RB tree, see 5:40 values (10, 11) have same color, but they are on different levels
2: Clip does not explain most important: why do we bother with trees coloring? What is a (useful) difference between RB and AVL

youwouldbetterfuckme
Автор

Question, why are the leaves in the animation red?

tarabost
Автор

The explanation is no thorough. I recommend redoing this video.
...Whenever you say "it's going to readjust" you should go through the steps that make it happen... 

JeanAlesiagain
Автор

The animations for a lot of videos are shit, this one is great! Thanks!

BrodieKurczynski
Автор

3:00 Tree is fixed by recolouring *AND rotation*

stephenhowe
Автор

is it important in rb trees to have all leaves node black

sattyagi