摘要:
http://changhaz.wordpress.com/2014/10/15/leetcode-find-minimum-in-rotated-sorted-array/Suppose a sorted array is rotated at some pivot unknown to you ... 阅读全文
posted @ 2014-10-17 23:20
Ryan in C++
阅读(327)
评论(0)
推荐(0)
摘要:
1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 class Solution { 8 public: 9 string getPermutation(int n, int k) {10 ... 阅读全文
posted @ 2014-10-17 19:45
Ryan in C++
阅读(240)
评论(0)
推荐(0)
摘要:
EdgeCase太容易出错。有两处都是应该为 2 #include 3 #include 4 using namespace std; 5 6 class Solution2 { 7 public: 8 void nextPermutation(vector &num) { 9 ... 阅读全文
posted @ 2014-10-17 11:11
Ryan in C++
阅读(522)
评论(0)
推荐(0)
摘要:
LeetCode:SubsetsGiven a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution... 阅读全文
posted @ 2014-10-17 08:10
Ryan in C++
阅读(230)
评论(0)
推荐(0)