@@ -0,0 +1,804 @@
+/***%0A * Given a binary tree, return the preorder traversal of its nodes' values.%0A *%0A * For example:%0A * Given binary tree %7B1,#,2,3%7D,%0A *    1%0A *     %5C%0A *      2%0A *     /%0A *    3%0A * return %5B1,2,3%5D.%0A */%0A/**%0A * Definition for binary tree%0A * public class TreeNode %7B%0A *     int val;%0A *     TreeNode left;%0A *     TreeNode right;%0A *     TreeNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Aimport java.util.List;%0Aimport java.util.ArrayList;%0Apublic class Solution %7B%0A    public List%3CInteger%3E preorderTraversal(TreeNode root) %7B%0A        List%3CInteger%3E ret = new ArrayList%3CInteger%3E();%0A        dfs(ret, root);%0A        return ret;%0A    %7D%0A%0A    private void dfs( List%3CInteger%3E ret, TreeNode node) %7B%0A        if (node == null)%0A            return;%0A        ret.add(node.val);%0A        dfs(ret, node.left);%0A        dfs(ret, node.right);%0A    %7D%0A%7D%0A

add BinaryTreePreorderTraversal.java