From: Mukund Sivaraman Date: Mon, 2 Sep 2013 09:55:09 +0000 (+0530) Subject: [2750] Add graphs for case 3 X-Git-Tag: bind10-1.2.0beta1-release~193^2~4^2~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a4c8c4fec6d869d9ecbbbab9c0374658cfd7a99;p=thirdparty%2Fkea.git [2750] Add graphs for case 3 --- diff --git a/src/lib/datasrc/memory/domaintree.h b/src/lib/datasrc/memory/domaintree.h index de232767ff..faf4424a5a 100644 --- a/src/lib/datasrc/memory/domaintree.h +++ b/src/lib/datasrc/memory/domaintree.h @@ -2756,6 +2756,29 @@ DomainTree::removeRebalance // child=parent and go back to the beginning of the loop to // repeat the original rebalancing problem 1 node higher up the // tree (see NOTE #1 above). + + /* (a): + * + * G(?) G(?) + * / \ / \ + * P(R) => P(B) (Rebalancing is done) + * / \ / \ + * C(?) S(B) C(?) S(R) + * / \ / \ / \ / \ + * s1(B) s2(B) s1(B) s2(B) + * + * + * (b): + * + * G(?) G(?) <----------(new parent) + * / \ / \ + * P(B) => P(B) <------------(new child) + * / \ / \ + * C(?) S(B) C(?) S(R) + * / \ / \ / \ / \ + * s1(B) s2(B) s1(B) s2(B) + */ + if ((DomainTreeNode::isBlack(sibling->getLeft()) && DomainTreeNode::isBlack(sibling->getRight()))) {