From 9941175a3c5c2b5f0d98a85bd9a2a4f6c9c809b7 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Thu, 6 Jun 2024 00:01:41 +0200 Subject: [PATCH] set grandpa's colour correctly --- libtree/src/red_black_tree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtree/src/red_black_tree.rs b/libtree/src/red_black_tree.rs index f0f0f22..7a690c9 100644 --- a/libtree/src/red_black_tree.rs +++ b/libtree/src/red_black_tree.rs @@ -293,7 +293,7 @@ impl RedBlackTree { if !uncle.is_null() && uncle.colour() == Red { uncle.set_colour(Black); parent.set_colour(Black); - grandparent.set_colour(Black); + grandparent.set_colour(Red); node = grandparent; } else { if parent.left() == node {