]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2750] Add graphs for case 3
authorMukund Sivaraman <muks@isc.org>
Mon, 2 Sep 2013 09:55:09 +0000 (15:25 +0530)
committerMukund Sivaraman <muks@isc.org>
Mon, 2 Sep 2013 09:55:20 +0000 (15:25 +0530)
src/lib/datasrc/memory/domaintree.h

index de232767ff079db082e6430107085019c6043ef0..faf4424a5af4e47a73bb5b91592ebeca3b89f973 100644 (file)
@@ -2756,6 +2756,29 @@ DomainTree<T>::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<T>::isBlack(sibling->getLeft()) &&
              DomainTreeNode<T>::isBlack(sibling->getRight())))
         {