摘要: class Solution {public: void merge(int A[], int m, int B[], int n) { int mi = m + n - 1; int ai = m - 1; int bi = n - 1; ... 阅读全文
posted @ 2014-05-29 19:55 卖程序的小歪 阅读(147) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: static int compare(const Interval& a, const Interval& b) { return a.start merge(vector &intervals) { vector... 阅读全文
posted @ 2014-05-29 19:21 卖程序的小歪 阅读(214) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: ListNode *mergeKLists(vector &lists) { ListNode* merged = NULL; for (int i=0; ival val) { n... 阅读全文
posted @ 2014-05-29 18:35 卖程序的小歪 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"click to show corner cas... 阅读全文
posted @ 2014-05-29 16:56 卖程序的小歪 阅读(189) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) { ListNode* p = l1; ListNode* q = l2; ListNode* he... 阅读全文
posted @ 2014-05-29 13:52 卖程序的小歪 阅读(175) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: string getPermutation(int n, int k) { k--; if (n nums(n, 0); long seg = 1; for (int i=0; i= se... 阅读全文
posted @ 2014-05-29 09:57 卖程序的小歪 阅读(157) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int climbStairs(int n) { if (n < 1) return 0; int a = 0; int b = 1; for (int i=0; i<n; i++) { ... 阅读全文
posted @ 2014-05-29 08:42 卖程序的小歪 阅读(131) 评论(0) 推荐(0) 编辑