491. 遞增子序列[https://leetcode.cn/problems/non-decreasing-subsequences/] 給你一個整數(shù)數(shù)組 nums 采蚀,找出...
491. 遞增子序列[https://leetcode.cn/problems/non-decreasing-subsequences/] 給你一個整數(shù)數(shù)組 nums 采蚀,找出...
93.復(fù)原IP地址 先跳過 78.子集 給你一個整數(shù)數(shù)組 nums 显设,數(shù)組中的元素 互不相同 憾筏。返回該數(shù)組所有可能的子集(冪集)。 解集 不能 包含重復(fù)的子集慰于。你可以按 任意...
39. 組合總和[https://leetcode.cn/problems/combination-sum/] 給你一個 無重復(fù)元素 的整數(shù)數(shù)組 candidates 和一個...
216. 組合總和 III[https://leetcode.cn/problems/combination-sum-iii/] 找出所有相加之和為 n 的 k 個數(shù)的組合酱讶,...
需要總結(jié)一下回溯的場景围苫、套路裤园、剪枝操作 77. 組合[https://leetcode.cn/problems/combinations/] 給定兩個整數(shù) n 和 k,返回范...
669. 修剪二叉搜索樹 難剂府。沒來得及弄拧揽。周六做 108. 將有序數(shù)組轉(zhuǎn)換為二叉搜索樹[https://leetcode.cn/problems/convert-sorted...
235. 二叉搜索樹的最近公共祖先 給定一個二叉搜索樹, 找到該樹中兩個指定節(jié)點的最近公共祖先。 百度百科中最近公共祖先的定義為:“對于有根樹 T 的兩個結(jié)點 p腺占、q淤袜,最近公...
530. 二叉搜索樹的最小絕對差[https://leetcode.cn/problems/minimum-absolute-difference-in-bst/] 給你一個...
617. 合并二叉樹[https://leetcode.cn/problems/merge-two-binary-trees/] 你兩棵二叉樹: root1 和 root2 ...
513. 找樹左下角的值[https://leetcode.cn/problems/find-bottom-left-tree-value/] 給定一個二叉樹的 根節(jié)點 ro...
110. 平衡二叉樹[https://leetcode.cn/problems/balanced-binary-tree/] 給定一個二叉樹,判斷它是否是高度平衡的二叉樹衰伯。本...
注意點:貌似所有的二叉樹題目铡羡,都可以通過層次遍歷解決 104. 二叉樹的最大深度[https://leetcode.cn/problems/maximum-depth-of-...
102. 二叉樹的層序遍歷[https://leetcode.cn/problems/binary-tree-level-order-traversal/] 給你二叉樹的根節(jié)...
144.二叉樹的前序遍歷(opens new window)[https://leetcode.cn/problems/binary-tree-preorder-traver...
20. 有效的括號 1047. 刪除字符串中的所有相鄰重復(fù)項[https://leetcode.cn/problems/remove-all-adjacent-duplica...
232. 用棧實現(xiàn)隊列[https://leetcode.cn/problems/implement-queue-using-stacks/] 關(guān)鍵點: 1.兩個棧inSta...
344. 反轉(zhuǎn)字符串[https://leetcode.cn/problems/reverse-string/] 編寫一個函數(shù),其作用是將輸入的字符串反轉(zhuǎn)過來诫惭。輸入字符串以字...
454.四數(shù)相加II 力扣題目鏈接(opens new window)[https://leetcode.cn/problems/4sum-ii/]給定四個包含整數(shù)的數(shù)組列表...
注意點 注意unordered_map\map\multimap 底層實現(xiàn)的算法結(jié)構(gòu)(哈希表還是紅黑樹),適用的場景的算法復(fù)雜度 ● 242.有效的字母異位詞 給定兩個字符串...