2013年7月2日
摘要: 1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 * TreeNode left; 6 * TreeNode right; 7 * TreeNode(int x) { val = x; } 8 * } 9 */10 public class Solution {11 public boolean isSameTree(TreeNode p, TreeNode q) {12 // Start typing your... 阅读全文
posted @ 2013-07-02 10:21 leiatpku 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1 public class Solution { 2 public int sqrt(int x) { 3 // Start typing your Java solution below 4 // DO NOT write main() function 5 double result = x; 6 7 while (Math.abs(result * result - x) > 0.0001) 8 { 9 result = (result + x / re... 阅读全文
posted @ 2013-07-02 09:29 leiatpku 阅读(235) 评论(0) 推荐(0) 编辑