摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]. 1 vector > permute(vector &num) { 2 vector > result; 3 if (num.size() == 0) return result; 4 5 std::sort(num.begi... 阅读全文
posted @ 2014-04-07 14:37 linyx 阅读(121) 评论(0) 推荐(0) 编辑