In the class com.thealgorithms.datastructures.trees.RedBlackBST, the preorder traversal is
public void printTreepre(Node node) {
if (node == nil) {
return;
}
System.out.print(
((node.color == R) ? " R " : " B ") + "Key: " + node.key + " Parent: " + node.p.key + "\n");
printTree(node.left);
printTree(node.right);
}
Should the last two lines call printTreepre rather than printTree?
printTree is an inorder traversal method.