public static boolean hasPathSum(TreeNode root, int sum) {
		if (null != root && null == root.left && null == root.right && sum == root.val) {
			return true;
		} else if (null != root) {
			if (null != root.left && hasPathSum(root.left, sum - root.val)) {
				return true;
			} else if (null != root.right && hasPathSum(root.right, sum - root.val)) {
				return true;
			}
		}
		return false;
    }