print values of bst java

Java
 void printTree(TreeNode node, String prefix)
 {
    if(node == null) return;

    System.out.println(prefix + " + " + node.data);
    printTree(node.left , prefix + " ");
    printTree(node.right , prefix + " ");
 }
Source

Also in Java: