2016年8月30日

STL priority_queue

摘要: 转自: STL容器之优先队列 - 拼装小火车 - 博客园 http://www.cnblogs.com/summerRQ/articles/2470130.html STL容器之优先队列 优先级队列,以前刷题的时候用的比较熟,现在竟然我只能记得它的关键字是priority_queue(太伤了)。在一 阅读全文

posted @ 2016-08-30 15:40 RenewDo 阅读(158) 评论(0) 推荐(0) 编辑

2016年7月19日

优先使用map(或者unordered_map)的find函数而非algorithm里的find函数

摘要: 今天写leetcode的 Two Sum这题一开始使用vector容器,然后使用algorithm里的find函数进行查找,如下: 发现会时间超时。后来改成用unordered_map通过了 通过比较这,发现差异在find的函数使用 map底层是红黑树实现的,因此它的find函数时间复杂度:O(lo 阅读全文

posted @ 2016-07-19 16:41 RenewDo 阅读(8495) 评论(0) 推荐(0) 编辑

2016年6月13日

Insert Interval

摘要: 1、 2、Merge Intervals 阅读全文

posted @ 2016-06-13 12:29 RenewDo 阅读(270) 评论(0) 推荐(0) 编辑

Integer Break

摘要: 1 class Solution { 2 public: 3 int integerBreak(int n) { 4 vector res(n+1,0); 5 res[1]=1; 6 res[2]=1; 7 for(int i=3; i<=n; i++) 8 { 9 ... 阅读全文

posted @ 2016-06-13 10:08 RenewDo 阅读(185) 评论(0) 推荐(0) 编辑

2016年6月6日

Unique Binary Search Trees

摘要: 1、Unique Binary Search Trees 阅读全文

posted @ 2016-06-06 11:39 RenewDo 阅读(180) 评论(0) 推荐(0) 编辑

2016年5月30日

腾讯2016实习生笔试

摘要: 求有删除情况的最长回文子串 阅读全文

posted @ 2016-05-30 10:00 RenewDo 阅读(201) 评论(0) 推荐(0) 编辑

Product of Array Except Self

摘要: 1、Product of Array Except Self 2、Maximum Subarray 3、Maximum Product Subarray 阅读全文

posted @ 2016-05-30 09:35 RenewDo 阅读(213) 评论(0) 推荐(0) 编辑

2016年5月26日

Nested List

摘要: 1、Nested List Weight Sum 2、Flatten Nested List Iterator 阅读全文

posted @ 2016-05-26 12:11 RenewDo 阅读(319) 评论(0) 推荐(0) 编辑

Search a 2D Matrix系列

摘要: 1、Search a 2D Matrix 2、Search a 2D Matrix II 阅读全文

posted @ 2016-05-26 10:59 RenewDo 阅读(130) 评论(0) 推荐(0) 编辑

2016年5月24日

Largest Number

摘要: 1 class Solution { 2 public: 3 string largestNumber(vector& nums) { 4 string s; 5 if(nums.empty()) 6 return s; 7 bool flag =false; 8 ... 阅读全文

posted @ 2016-05-24 11:33 RenewDo 阅读(161) 评论(0) 推荐(0) 编辑

导航