- 博客(5)
- 收藏
- 关注
原创 【LeetCode】Longest Palindromic Substring
参考:http://blog.csdn.net/soszou/article/details/37312317public class Solution { public String longestPalindrome(String s) { int len = s.length(); String ans = ""; Stri
2014-12-17 09:47:09 841
原创 【LeetCode】Search in Rotated Sorted Array II
public class Solution { public boolean binarySearch0(int[] num, int l, int h, int target){ while(l <= h){ int mid = l + (( h - l) >> 1); if(num[mid] > target) h = m
2014-12-15 12:52:37 788
原创 【LeetCode】Search in Rotated Sorted Array
public class Solution { public int binarySearch0(int[] num, int l, int h, int target){//普通的二分查找 while(l <= h){ int mid = l + (( h - l) >> 1); if(num[mid] > target)
2014-12-15 12:50:05 673
原创 【LeetCode】Flatten Binary Tree to Linked List
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */public class Solution { //获取根节点的先
2014-12-05 11:09:39 604
原创 【LeetCode】Search for a Range
public class Solution { public int binarySearchFirst(int[] A, int target){ int l = 0, h = A.length - 1; int p = -1; while(l <= h){ int mid = l + ((h - l) >> 1);
2014-12-02 19:44:28 660
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人