2015年5月25日

【leetcode】【单链表】【148】Sort List

摘要: #includeusing namespace std;struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {}};class Solution {public: ListNode* merg... 阅读全文

posted @ 2015-05-25 18:29 ruan875417 阅读(135) 评论(0) 推荐(0) 编辑

【leetcode】【单链表】【147】Insertion Sort List

摘要: #includeusing namespace std;struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {}};class Solution {public: ListNode* inse... 阅读全文

posted @ 2015-05-25 16:17 ruan875417 阅读(115) 评论(0) 推荐(0) 编辑

【STL源码剖析读书笔记】【第6章】算法之next_permutation和prev_permutation算法

摘要: 1、next_permutation()会取得[first, last)所标示序列的下一个排列组合,如果没有下一个排列组合,返回false,否则返回true。2、next_permutation()函数算法原理:从最尾端开始寻找两个相邻的元素,令第一个元素是*i,第二个元素是*ii,且满足*i bo... 阅读全文

posted @ 2015-05-25 10:10 ruan875417 阅读(151) 评论(0) 推荐(0) 编辑

导航