@@ -0,0 +1,512 @@
+package leetcode.oj.pathSum;%0A%0A//http://oj.leetcode.com/problems/path-sum/%0A%0Apublic class Solution %7B%0A%09public boolean hasPathSum(TreeNode root, int sum) %7B%0A%09%09if (root == null) %7B%0A%09%09%09return false;%0A%09%09%7D else if (root.val == sum && root.left == null && root.right == null) %7B%0A%09%09%09return true;%0A%09%09%7D else %7B%0A%0A%09%09%09int newSum = sum - root.val;%0A%09%09%09return hasPathSum(root.left, newSum)%0A%09%09%09%09%09%7C%7C hasPathSum(root.right, newSum);%0A%09%09%7D%0A%09%7D%0A%7D%0A%0Aclass TreeNode %7B%0A%09int val;%0A%09TreeNode left;%0A%09TreeNode right;%0A%0A%09TreeNode(int x) %7B%0A%09%09val = x;%0A%09%7D%0A%7D%0A

add code