Search code examples
data-structuresred-black-tree

Do every implementation of Red-Black Tree have the same number of red nodes for the same input?


Can there be implementations resulting different Red-Black Trees for the same input?


Solution

  • Yes. There are choices to make about how to maintain the RB-tree constraints, so different implementations can produce different trees.