摘要:
public class Solution { public int removeElement(int[] nums, int val) { int sum=0; int len=nums.length; int end=len; int i=0; while(i<end) { ... 阅读全文
posted @ 2016-04-04 22:20
阿怪123
阅读(120)
评论(0)
推荐(0)
摘要:
public class Solution { public void sortColors(int[] nums) { int len=nums.length; int red=0; int white=0; int blue=0; for(int i=0;i<len;i++) { ... 阅读全文
posted @ 2016-04-04 22:05
阿怪123
阅读(83)
评论(0)
推荐(0)
摘要:
public class Solution { public TreeNode sortedArrayToBST(int[] nums) { int len=nums.length; TreeNode res=buildNode(0,len-1,nums); return res; } ... 阅读全文
posted @ 2016-04-04 21:51
阿怪123
阅读(105)
评论(0)
推荐(0)
摘要:
public class Solution { public int maxSubArray(int[] nums) { int len=nums.length; if(len==0) return 0; int res=0; int[] results=new int[len]; f... 阅读全文
posted @ 2016-04-04 21:22
阿怪123
阅读(100)
评论(0)
推荐(0)
摘要:
public class Solution { public List grayCode(int n) { //格雷码 /* 2位元格雷码 00 01 11 10 3位元格雷码 000 001 011 010 ... 阅读全文
posted @ 2016-04-04 15:06
阿怪123
阅读(144)
评论(0)
推荐(0)
摘要:
public class Solution { public boolean searchMatrix(int[][] matrix, int target) { int rows=matrix.length; int columns=matrix[0].length; boolean res=false; for(int ... 阅读全文
posted @ 2016-04-04 14:28
阿怪123
阅读(92)
评论(0)
推荐(0)
摘要:
public class Solution { public int findMin(int[] nums) { int len=nums.length; for(int i=0;i=0) { if(nums[i]<nums[i-1]) return nums[... 阅读全文
posted @ 2016-04-04 14:17
阿怪123
阅读(84)
评论(0)
推荐(0)
摘要:
动态规划问题 阅读全文
posted @ 2016-04-04 14:07
阿怪123
阅读(81)
评论(0)
推荐(0)
摘要:
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solution { public ListNode mer... 阅读全文
posted @ 2016-04-04 13:59
阿怪123
阅读(96)
评论(0)
推荐(0)
摘要:
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution { ... 阅读全文
posted @ 2016-04-04 13:51
阿怪123
阅读(116)
评论(0)
推荐(0)
摘要:
public class Solution { public int climbStairs(int n) { if(n==1) return 1; if(n==2) return 2; int[] res=new int[n+1]; res[1]=1; res... 阅读全文
posted @ 2016-04-04 10:25
阿怪123
阅读(92)
评论(0)
推荐(0)
摘要:
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solution { public ListNode del... 阅读全文
posted @ 2016-04-04 10:16
阿怪123
阅读(90)
评论(0)
推荐(0)
摘要:
public class Solution { public int searchInsert(int[] nums, int target) { int len=nums.length; int i=0; for(;i=target) break; } return i; ... 阅读全文
posted @ 2016-04-04 10:07
阿怪123
阅读(83)
评论(0)
推荐(0)

浙公网安备 33010602011771号