lichao_normal

导航

2016年12月9日 #

Search Insert Position

摘要: int searchInsert(int* nums, int numsSize, int target) { int low=0; if(numsSize<=0)return 0; int high=numsSize-1; int mid; while(low<=high){ mid=(low+h 阅读全文

posted @ 2016-12-09 20:37 lichao_normal 阅读(68) 评论(0) 推荐(0) 编辑

Search for a Range

摘要: Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the or 阅读全文

posted @ 2016-12-09 20:36 lichao_normal 阅读(71) 评论(0) 推荐(0) 编辑

Search in Rotated Sorted Array

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 4 5 6 7 0 1 2). You are given a target value to search. If found in 阅读全文

posted @ 2016-12-09 11:04 lichao_normal 阅读(348) 评论(0) 推荐(0) 编辑

Longest Valid Parentheses

摘要: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo 阅读全文

posted @ 2016-12-09 10:51 lichao_normal 阅读(201) 评论(0) 推荐(1) 编辑