void RedBlackTree::printPreorder(RedBlackNode *root, int depth){
if(root == NULL)
return;
for(int i=0; i<=depth; i++)
cout <<" ";
depth++;
cout << root->data << endl;
printInorder(root->left, depth);
printInorder(root->right, depth);
}
Give it a try!!