chiark / gitweb /
rbtree.c (rbtree_splitroot): Count output black-heights correctly.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 20 Aug 2024 19:15:20 +0000 (20:15 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 20 Aug 2024 19:30:58 +0000 (20:30 +0100)
commita93c3ff7828cbc443d9c92a4fb9107c818a8302e
treec5c576560579ad917195a322f315ffb23ce2a4c8
parent9e97e8c9f94477cd4ad04f8a5314bebef0e3d54f
rbtree.c (rbtree_splitroot): Count output black-heights correctly.

The root is black, so the default would be that the subtrees have
black-height one less.  But if their roots (exist and) are red, then
we'll blacken them, which increases the black-height by one again.
rb-rbregress.ref
rbregress.in
rbtree.c