private void doPrintTree(ExpressionNode node, int depth) { if (node != null) { if (node.getLeftChild() != null) { doPrintTree(node.getLeftChild(), depth + 1); } if (node.getRightChild() != null) { doPrintTree(node.getRightChild(), depth + 1); } } }