8/30/2014
8/29/2014
8/27/2014
[LC] 3Sum, 3Sum Closest, 4Sum
3Sum
Keyword: Binary Search.
3Sum Closest
Keyword: Approaching.
4Sum
Keyword: Hash, Set.
[LC] Median of Two Sorted Arrays
Median of Two Sorted Arrays
Consider more general case: k-th number of these arrays.
Keyword: Binary Search.
8/26/2014
[LC] Search in Rotated Sorted Array I & II
Search in Rotated Sorted Array I
Search in Rotated Sorted Array II
Keyword: Binary Search, Boundary condition.
[LC] Remove Duplicates from Sorted Array I & II
Remove Duplicates from Sorted Array I
Remove Duplicates from Sorted Array II
Add one more variable to record the number of repeated elements.
8/25/2014
[LC] Unique Binary Search Trees I & II
Unique Binary Search Trees I
Keywords: 1-D dynamic programming.
Unique Binary Search Trees II
Build a function whose input is the range of the subtree and output is the subtrees based on this range.
vector<TreeNode*> generate(int beg, int end){
/*...*/
return ans;
}
Keywords: Bottom up.
訂閱:
意見 (Atom)