摘要:
The recursive solution is trivial and I omit it here.Iterative Solution using Stack (O(n)time andO(n)space): 1 /** 2 * Definition of TreeNode: 3 * c... 阅读全文
摘要:
A subroutine of merge sort. 1 class Solution { 2 public: 3 /** 4 * @param A and B: sorted integer array A and B. 5 * @return: A new sort... 阅读全文
摘要:
The recursive solution is trivial and I omit it here.Iterative Solution using Stack (O(n)time andO(n)space): 1 /** 2 * Definition of TreeNode: 3 * c... 阅读全文
摘要:
The recursive solution is trivial and I omit it here.Iterative Solution using Stack (O(n) time and O(n) space): 1 /** 2 * Definition of TreeNode: 3 ... 阅读全文
摘要:
动态规划:lis[i] = max_{j = 0, 1, ..., i - 1, nums[j] nums) { 8 // write your code here 9 vector lis(nums.size(), 1);10 int maxlen... 阅读全文
摘要:
1 class Solution { 2 public: 3 /** 4 * @param strs: A list of strings 5 * @return: The longest common prefix 6 */ 7 string... 阅读全文
摘要:
Bit-by-Bit summation: 1 class Solution { 2 public: 3 /* 4 * @param a: The first integer 5 * @param b: The second integer 6 * @retur... 阅读全文