2016年4月27日

构建乘积数组

摘要: class Solution { public: vector multiply(const vector& A) { vectorres; vector left(A.size(),1); vector right(A.size(),1); for(int i=1;i=0;i--) right[i]=A[i+1]*r... 阅读全文

posted @ 2016-04-27 22:08 RenewDo 阅读(74) 评论(0) 推荐(0) 编辑

数组中重复的数字

摘要: 1 class Solution { 2 public: 3 // Parameters: 4 // numbers: an array of integers 5 // length: the length of array numbers 6 // duplication: (Ou... 阅读全文

posted @ 2016-04-27 21:33 RenewDo 阅读(165) 评论(0) 推荐(0) 编辑

Implement Stack using Queues

摘要: 1 class Stack { 2 public: 3 // Push element x onto stack. 4 void push(int x) { 5 if(q1.empty()&&q2.empty()) 6 q1.push(x); 7 else 8 { 9 ... 阅读全文

posted @ 2016-04-27 21:02 RenewDo 阅读(174) 评论(0) 推荐(0) 编辑

导航