一個(gè)inorder traverse 的iteration: 先循環(huán)左邊,左邊循環(huán)完循環(huán)右邊熙卡,但是右邊的node也要循環(huán)他的左邊杖刷,所以要把循環(huán)左邊的while循環(huán)和獲得右邊n...
一個(gè)inorder traverse 的iteration: 先循環(huán)左邊,左邊循環(huán)完循環(huán)右邊熙卡,但是右邊的node也要循環(huán)他的左邊杖刷,所以要把循環(huán)左邊的while循環(huán)和獲得右邊n...
Coin Change Boundary: There may be no possible change, so in this scenario, should chec...
House Robber [2,1,1,2] => 并不是每隔一個(gè)加一就是最佳最佳問(wèn)題=>考慮DP=>思考循環(huán)的關(guān)聯(lián)對(duì)于一個(gè)nums[i]: rob, 那么至此得到的總價(jià)是 ...
我!終于再膳!成功在MAC下面把opencv4程序靜態(tài)編譯起來(lái)了挺勿!先上compile的命令:g++ -std=c++11 main.cpp preprocess.cpp -fra...
Best Time to Buy and Sell Stock 其實(shí)也算是DP,每次的結(jié)果和前一次的結(jié)果比較 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輸入值是數(shù)組考慮長(zhǎng)度為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 鏈表時(shí)沒(méi)有考慮鏈表是NULL的情況 如果malloc newh->value 失敗不瓶,返回錯(cuò)誤時(shí)要把之前成功malloc的newh取消
來(lái)源: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...