JasonChang

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页

2013年11月18日

摘要: dynamic programming 1 public class Solution { 2 public int maximalRectangle(char[][] matrix) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 if(matrix == null||matrix.length == 0) 6 ... 阅读全文
posted @ 2013-11-18 16:32 JasonChang 阅读(182) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ListNode partition(ListNode head, int x) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ListNode fakeLeftHead = new ListNode(0); 6 ListNode fa... 阅读全文
posted @ 2013-11-18 15:54 JasonChang 阅读(163) 评论(0) 推荐(0) 编辑

2013年11月13日

摘要: recursion 1 public class Solution { 2 public ArrayList> combine(int n, int k) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ArrayList> result = new ArrayList>(); 6 if(n list = ... 阅读全文
posted @ 2013-11-13 15:33 JasonChang 阅读(231) 评论(0) 推荐(0) 编辑

摘要: 判断左右哪一半sorted对那一边进行binary search 1 public class Solution { 2 public boolean search(int[] A, int target) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 if(A == null) 6 return ... 阅读全文
posted @ 2013-11-13 15:14 JasonChang 阅读(152) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public int search(int[] A, int target) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 if(A == null) 6 return -1; 7 int left = 0; 8 ... 阅读全文
posted @ 2013-11-13 15:03 JasonChang 阅读(158) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ArrayList grayCode(int n) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ArrayList result = new ArrayList(); 6 if(n >1));11 return res... 阅读全文
posted @ 2013-11-13 03:24 JasonChang 阅读(151) 评论(0) 推荐(0) 编辑

2013年11月12日

摘要: dynamic programming 1 public class Solution { 2 public int numDecodings(String s) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 int length = s.length(); 6 if(0 == length || s.ch... 阅读全文
posted @ 2013-11-12 15:35 JasonChang 阅读(150) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ArrayList> subsetsWithDup(int[] num) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ArrayList> result = new ArrayList>(); 6 ArrayList list = n... 阅读全文
posted @ 2013-11-12 13:58 JasonChang 阅读(142) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ArrayList> subsets(int[] S) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ArrayList> result = new ArrayList>(); 6 ArrayList list = new ArrayL... 阅读全文
posted @ 2013-11-12 13:57 JasonChang 阅读(200) 评论(0) 推荐(0) 编辑

摘要: 1 public class Solution { 2 public ListNode reverseBetween(ListNode head, int m, int n) { 3 // IMPORTANT: Please reset any member data you declared, as 4 // the same Solution instance will be reused for each test case. 5 ListNode newhead = new ListNode(0); 6 7 ... 阅读全文
posted @ 2013-11-12 13:18 JasonChang 阅读(149) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页