摘要:
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... 阅读全文
摘要:
本文参考基数排序http://hxraid.iteye.com/blog/648532桶排序 http://hxraid.iteye.com/blog/647759基于比较的排序http://hxraid.iteye.com/blog/646760 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
1 迭代,重要关系 p->right = s.top(); 1 class flat{ 2 public: 3 void flatten(TreeNode* root) { 4 if (root == NULL) return; 5 ... 阅读全文