LeetCode --- 35. Search Insert Position Feb 1, 2015

 Tags LeetCode , C++ , 数组 , 二分搜索

题目链接:Search Insert PositionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inse... More »

0条评论

LeetCode --- 34. Search for a Range Feb 1, 2015

 Tags LeetCode , C++ , 数组 , 二分搜索

题目链接:Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in t... More »

0条评论

LeetCode --- 33. Search in Rotated Sorted Array Jan 31, 2015

 Tags LeetCode , C++ , 数组 , 二分搜索

题目链接:Search in Rotated Sorted ArraySuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are g... More »

0条评论

LeetCode --- 32. Longest Valid Parentheses Jan 31, 2015

 Tags LeetCode , C++ , 动态规划 , 字符串 ,

题目链接:Longest Valid ParenthesesGiven a string containing just the characters ‘(‘ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.For “... More »

0条评论

LeetCode --- 31. Next Permutation Jan 30, 2015

 Tags LeetCode , C++ , 数组

题目链接:Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not pos... More »

0条评论

LeetCode --- 30. Substring with Concatenation of All Words Jan 30, 2015

 Tags LeetCode , C++ , Hash表 , 双指针 , 字符串

题目链接:Substring with Concatenation of All WordsYou are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substrin... More »

0条评论

LeetCode --- 29. Divide Two Integers Jan 29, 2015

 Tags LeetCode , C++ , 数学 , 二分搜索

题目链接:Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.这道题的要求是在不使用乘法、除法、取模运算的前提下实现两个整数相除... More »

0条评论

LeetCode --- 28. Implement strStr() Jan 29, 2015

 Tags LeetCode , C++ , 字符串 , 双指针

题目链接:Implement strStr()Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02):... More »

0条评论

LeetCode --- 27. Remove Element Jan 29, 2015

 Tags LeetCode , C++ , 数组 , 双指针

题目链接:Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn’t m... More »

0条评论

LeetCode --- 26. Remove Duplicates from Sorted Array Jan 29, 2015

 Tags LeetCode , C++ , 数组 , 双指针

题目链接:Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not a... More »

0条评论