This did not matter during the remove() so far, but in the future
we may not call exchange() even for some cases of non-leaf nodes.
}
}
+ // If node is assigned to the down_ pointer of its parent, it is a
+ // subtree root and must have the flag set.
+ if (node->getParent() &&
+ (node->getParent()->getDown() == node) &&
+ (!node->isSubTreeRoot()))
+ {
+ return (false);
+ }
+
// Repeat tests with this node's children.
return (checkPropertiesHelper(node->getLeft()) &&
checkPropertiesHelper(node->getRight()) &&