摘要: 1,关于递归还是要有时间就练习,又有些生疏了/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeN... 阅读全文
posted @ 2014-10-28 05:18 lilyfindjob 阅读(82) 评论(0) 推荐(0)
摘要: 挺简单的,没什么好说的public class Solution { public int removeElement(int[] A, int elem) { int j=0; for(int i=0;i<A.length;i++){ if(... 阅读全文
posted @ 2014-10-27 12:13 lilyfindjob 阅读(79) 评论(0) 推荐(0)
摘要: 1, 思考过程比较慢,加强锻炼2,空字符串的定义,不能用null3,数组的长度为array.length,而string的长度为函数 string.length()public class Solution { public String longestCommonPrefix(String[... 阅读全文
posted @ 2014-10-27 11:51 lilyfindjob 阅读(92) 评论(0) 推荐(0)
摘要: 做这道题的时候思路不是很清晰。写的乱七八糟!!挺简单的一道题,向别人写的学习!!package Leetcode;public class MergeSortedArray { public static void merge(int A[], int m, int B[], int n) {... 阅读全文
posted @ 2014-10-26 11:46 lilyfindjob 阅读(99) 评论(0) 推荐(0)
摘要: 1,采用reverse的方法,来比较是不是palindrome2,reverse number的方法!!3,还要记得负数的情况package Leetcode;public class PalindromeNumber {public boolean isPalindrome(int x) { ... 阅读全文
posted @ 2014-10-26 07:34 lilyfindjob 阅读(82) 评论(0) 推荐(0)
摘要: 1, string.trim()将string中的空格去掉。2,java 中有定义int的最大值和最小值,Integer.MAX_VALUE Integer.MIN_VALUE3,将char的值转换为integer的值, 就-‘0’public class stringtoint { publ... 阅读全文
posted @ 2014-10-25 07:41 lilyfindjob 阅读(125) 评论(0) 推荐(0)