摘要: Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm s... 阅读全文
posted @ 2014-06-14 14:52 穆穆兔兔 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 本文参考基数排序http://hxraid.iteye.com/blog/648532桶排序 http://hxraid.iteye.com/blog/647759基于比较的排序http://hxraid.iteye.com/blog/646760 阅读全文
posted @ 2014-06-14 11:27 穆穆兔兔 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Follow up for ”Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted array A = [1,1,1,2,2,3],Your function should... 阅读全文
posted @ 2014-06-14 11:03 穆穆兔兔 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear only onceand return the new length.Do not allocate extra space for ... 阅读全文
posted @ 2014-06-14 10:51 穆穆兔兔 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 迭代,重要关系 p->right = s.top(); 1 class flat{ 2 public: 3 void flatten(TreeNode* root) { 4 if (root == NULL) return; 5 ... 阅读全文
posted @ 2014-06-14 10:38 穆穆兔兔 阅读(178) 评论(0) 推荐(0) 编辑