码迷,mamicode.com
首页 >  
搜索关键字:refresh    ( 1347个结果
LeetCode – Refresh – Merge Two Sorted Lists
Iterative: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : ...
分类:其他好文   时间:2015-03-21 08:37:15    阅读次数:117
LeetCode – Refresh – Minimum Window Substring
Notes:1. When check left shifting, do not use continue, but break it!!! Otherwise, you wil fall into infinite loop2. Initialize the map with T, not S!...
分类:Windows程序   时间:2015-03-21 08:36:53    阅读次数:160
LeetCode – Refresh – Missing Ranges
1 class Solution { 2 public: 3 string getRange(int start, int end) { 4 ostringstream oss; 5 if (start == end) { 6 oss...
分类:其他好文   时间:2015-03-21 08:36:43    阅读次数:154
LeetCode – Refresh – Minimum Path Sum
Simple DP, but notes:1. initialize the array not only for dp[i] += dp[i-1], but also dp[i] += dp[i-1] + grid[i][0];2. Clear that we are using one dime...
分类:其他好文   时间:2015-03-21 08:35:36    阅读次数:115
LeetCode – Refresh – Minimum Depth of Binary Tree
1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(i...
分类:其他好文   时间:2015-03-21 08:35:28    阅读次数:123
LeetCode – Refresh – Min Stack
Use two stacks :class MinStack {private: stack s, minS;public: void push(int x) { if (minS.empty() || x s;public: void push(int x) { ...
分类:其他好文   时间:2015-03-21 08:34:04    阅读次数:124
LeetCode – Refresh – Merge Intervals
1 /** 2 * Definition for an interval. 3 * struct Interval { 4 * int start; 5 * int end; 6 * Interval() : start(0), end(0) {} 7 * ...
分类:其他好文   时间:2015-03-21 07:32:56    阅读次数:121
LeetCode – Refresh – Merge Sorted Array
Note:Since it merged from end, so1. tmp1, tmp2 = INT_MIN2. tmp1 > tmp2 1 class Solution { 2 public: 3 void merge(int A[], int m, int B[], int n) {...
分类:其他好文   时间:2015-03-21 07:32:13    阅读次数:117
LeetCode – Refresh – Merge k Sorted Lists
Use merge two looply merge the from the queue. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNod...
分类:其他好文   时间:2015-03-21 07:30:23    阅读次数:126
LeetCode – Refresh – Maximum Depth of Binary Tree
1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(i...
分类:其他好文   时间:2015-03-21 06:22:17    阅读次数:111
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!