上一页 1 ··· 3 4 5 6 7

2013年7月3日

search for range

摘要: 1 class Solution { 2 public: 3 vector searchRange(int A[], int n, int target) { 4 // Start typing your C/C++ solution below 5 // DO NOT write int main() function 6 vector v(2,-1); 7 8 int l = 0, m , r = n-1; 9 10 while( l=0 && A[r] == target ) v... 阅读全文

posted @ 2013-07-03 17:49 jumping_grass 阅读(140) 评论(0) 推荐(0)

search insert position

摘要: 1 class Solution { 2 public: 3 int searchInsert(int A[], int n, int target) { 4 // Start typing your C/C++ solution below 5 // DO NOT write int main() function 6 int lt = 0, rt = n-1; 7 while(lt target )13 rt = mid - 1;14 else 15 ... 阅读全文

posted @ 2013-07-03 17:31 jumping_grass 阅读(151) 评论(0) 推荐(0)

生成括号组合

摘要: void generate( int n_match, int sum, vector& v ) { if( n_match v1 = v; vector v2 = v; v.clear(); for( int i=0; i 0 ) { for( int i=0; i generateParenthesis(int n) { // Start typing your C/C++ solution below ... 阅读全文

posted @ 2013-07-03 17:21 jumping_grass 阅读(180) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7

导航