01 2017 档案
摘要:这类问题可以先用递归思考,再反过来想出动态规划的方法。 10. Regular Expression Matching 32. Longest Valid Parentheses 44. Wildcard Matching 72. Edit Distance 97. Interleaving Str
阅读全文
摘要:121. Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitte
阅读全文
摘要:lo和hi都是inclusive的。 返回的数组中,index小于j的数都小于等于j,index大于j的数都大于等于j
阅读全文
摘要:procedure three-way-partition(A : array of values, mid : value): i ← 0 j ← 0 n ← size of A - 1 while j ≤ n: if A[j] < mid: swap A[i] and A[j] i ← i +
阅读全文
摘要:很开心,自己想出来的一道题 There is a list of sorted integers from 1 to n. Starting from left to right, remove the first number and every other number afterward un
阅读全文

浙公网安备 33010602011771号