Solved BinaryTreePreorderTraversal in java