set grandpa's colour correctly
This commit is contained in:
parent
2d8a36e932
commit
9941175a3c
1 changed files with 1 additions and 1 deletions
|
@ -293,7 +293,7 @@ impl RedBlackTree {
|
||||||
if !uncle.is_null() && uncle.colour() == Red {
|
if !uncle.is_null() && uncle.colour() == Red {
|
||||||
uncle.set_colour(Black);
|
uncle.set_colour(Black);
|
||||||
parent.set_colour(Black);
|
parent.set_colour(Black);
|
||||||
grandparent.set_colour(Black);
|
grandparent.set_colour(Red);
|
||||||
node = grandparent;
|
node = grandparent;
|
||||||
} else {
|
} else {
|
||||||
if parent.left() == node {
|
if parent.left() == node {
|
||||||
|
|
Loading…
Reference in a new issue