一个inorder traverse 的iteration: 先循环左边,左边循环完循环右边,但是右边的node也要循环他的左边,所以要把循环左边的while循环和获得右边n...
一个inorder traverse 的iteration: 先循环左边,左边循环完循环右边,但是右边的node也要循环他的左边,所以要把循环左边的while循环和获得右边n...
Coin Change Boundary: There may be no possible change, so in this scenario, should chec...
House Robber [2,1,1,2] => 并不是每隔一个加一就是最佳最佳问题=>考虑DP=>思考循环的关联对于一个nums[i]: rob, 那么至此得到的总价是 ...
我!终于!成功在MAC下面把opencv4程序静态编译起来了!先上compile的命令:g++ -std=c++11 main.cpp preprocess.cpp -fra...
Best Time to Buy and Sell Stock 其实也算是DP,每次的结果和前一次的结果比较 Best Time to Buy and Sell Stock ...
Subsets Bit manipulation and map can be useful aside from backtracking Path Sum Don't s...
Climbing Stairs Just Fibonacci. Dynamic Programming's space complexity can be optimized...
Combination Sum Most basic backtracking. The idea of begin position is excellent, avoid...
输入值是指针考虑是不是NULL, next是不是NULL输入值是数组考虑长度为0 Search a 2D Matrix II Instead of beginning wit...
暑假一定要好好刷题-皿- 为了不996 Maximum Subarray Pay attention to boundary contidion. When initiali...
Longest Substring Without Repeating Characters Insert postion for unsorted_set is deffe...
Valid Parentheses Boundary Condition: consider just having left parenthese and right pa...
free 链表时没有考虑链表是NULL的情况 如果malloc newh->value 失败,返回错误时要把之前成功malloc的newh取消
来源:http://john-ahlgren.blogspot.com/2013/10/stl-container-performance.html
Two Sum Brute Force: time O(n^2) space O(1) Hash Map: time O(n) space O(n) Add Two Numb...