开启LeetCode之路
終于有時(shí)間開始每天堅(jiān)持做LeetCode題,博主現(xiàn)在以在CSDN上撰寫解題思路為自我監(jiān)督方式,堅(jiān)持每天將當(dāng)天的題目的解題思路記錄下來。
LeetCode刷題路線:博主將計(jì)劃按tag順序做題,先以簡(jiǎn)單和中等難度為主。
編程語(yǔ)言:博主選擇用C++來解題并記錄。
共勉~
?
第一部分:棧
2019-05-09:
Leetcode 232. 用棧實(shí)現(xiàn)隊(duì)列 :?https://blog.csdn.net/gjh13/article/details/90034055? 難度:簡(jiǎn)單
LeetCode 496. 下一個(gè)更大元素 I :https://blog.csdn.net/gjh13/article/details/90047695?難度:簡(jiǎn)單
Leetcode 682. 棒球比賽:https://blog.csdn.net/gjh13/article/details/90048331?難度:簡(jiǎn)單
?
2019-05-10
Leetcode 844. 比較含退格的字符串:https://blog.csdn.net/gjh13/article/details/90085181?難度:簡(jiǎn)單
Leetcode 94. 二叉樹的中序遍歷:https://blog.csdn.net/gjh13/article/details/90085551?難度:中等
?
2019-05-13
Leetcode 103. 二叉樹的鋸齒形層次遍歷:https://blog.csdn.net/gjh13/article/details/90182542?難度:中等
Leetcode 144. 二叉樹的前序遍歷:https://blog.csdn.net/gjh13/article/details/90183335?難度:中等
?
2019-05-14
Leetcode 150. 逆波蘭表達(dá)式求值:https://blog.csdn.net/gjh13/article/details/90212020?難度:中等
Leetcode 173. 二叉搜索樹迭代器:https://blog.csdn.net/gjh13/article/details/90213612?難度:中等
?
第二部分:堆
2019-05-15
Leetcode 703. 數(shù)據(jù)流中的第K大元素:https://blog.csdn.net/gjh13/article/details/90246978?難度:簡(jiǎn)單
Leetcode 215. 數(shù)組中的第K個(gè)最大元素:https://blog.csdn.net/gjh13/article/details/90247102?難度:中等
?
2019-05-16
Leetcode 264. 丑數(shù) II:https://blog.csdn.net/gjh13/article/details/90247437?難度:中等
Leetcode 313. 超級(jí)丑數(shù):https://blog.csdn.net/gjh13/article/details/90258606?難度:中等
Leetcode 347. 前K個(gè)高頻元素:https://blog.csdn.net/gjh13/article/details/90262399?難度:中等
Leetcode 373. 查找和最小的K對(duì)數(shù)字:https://blog.csdn.net/gjh13/article/details/90273634?難度:中等
?
2019-05-17
Leetcode 378. 有序矩陣中第K小的元素:https://blog.csdn.net/gjh13/article/details/90300904?難度:中等
Leetcode 451. 根據(jù)字符出現(xiàn)頻率排序:https://blog.csdn.net/gjh13/article/details/90301243?難度:中等
?
第三部分:貪心算法
貪心算法的學(xué)習(xí)可看看這個(gè)博客:https://www.cnblogs.com/steven_oyj/archive/2010/05/22/1741375.html
2019-05-18
Leetcode 122. 買賣股票的最佳時(shí)機(jī) II :https://blog.csdn.net/gjh13/article/details/90313752?難度:簡(jiǎn)單
Leetcode 455. 分發(fā)餅干:https://blog.csdn.net/gjh13/article/details/90313874?難度:簡(jiǎn)單
Leetcode 860. 檸檬水找零:https://blog.csdn.net/gjh13/article/details/90314185?難度:簡(jiǎn)單
Leetcode 134. 加油站:https://blog.csdn.net/gjh13/article/details/90314626?難度:中等
?
2019-05-19
Leetcode 376. 擺動(dòng)序列:https://blog.csdn.net/gjh13/article/details/90341549?難度:中等
Leetcode 392. 判斷子序列:https://blog.csdn.net/gjh13/article/details/90341922?難度:中等
?
第四部分:排序
2019-05-19
Leetcode 242. 有效的字母異位詞:https://blog.csdn.net/gjh13/article/details/90342031?難度:簡(jiǎn)單
Leetcode 349. 兩個(gè)數(shù)組的交集:https://blog.csdn.net/gjh13/article/details/90342471:難度:簡(jiǎn)單
Leetcode 350. 兩個(gè)數(shù)組的交集 II:https://blog.csdn.net/gjh13/article/details/90342609?難度:簡(jiǎn)單
?
2019-05-23
Leetcode 147. 對(duì)鏈表進(jìn)行插入排序:https://blog.csdn.net/gjh13/article/details/90480218?難度:中等
?
2019-05-25
Leetcode 148. 排序鏈表:https://blog.csdn.net/gjh13/article/details/90545932?難度:中等
Leetcode 179. 最大數(shù):https://blog.csdn.net/gjh13/article/details/90547131?難度:中等
Leetcode 220. 存在重復(fù)元素 III:https://blog.csdn.net/gjh13/article/details/90550167?難度:中等
?
第五部分:位運(yùn)算
2019-05-25
Leetcode 136. 只出現(xiàn)一次的數(shù)字:https://blog.csdn.net/gjh13/article/details/90550405?難度:簡(jiǎn)單
Leetcode 169. 求眾數(shù):https://blog.csdn.net/gjh13/article/details/90550660?難度:簡(jiǎn)單
?
2019-06-01
Leetcode 190. 顛倒二進(jìn)制位:https://blog.csdn.net/gjh13/article/details/90727877?難度:簡(jiǎn)單
Leetcode 191. 位1的個(gè)數(shù):https://blog.csdn.net/gjh13/article/details/90728069?難度:簡(jiǎn)單
Leetcode 231. 2的冪 :https://blog.csdn.net/gjh13/article/details/90728209?難度:簡(jiǎn)單
Leetcode 268. 缺失數(shù)字 :https://blog.csdn.net/gjh13/article/details/90728515?難度:簡(jiǎn)單
Leetcode 137. 只出現(xiàn)一次的數(shù)字 II :https://blog.csdn.net/gjh13/article/details/90728971?難度:中等
Leetcode 187. 重復(fù)的DNA序列 :https://blog.csdn.net/gjh13/article/details/90733161?難度:中等
Leetcode 201. 數(shù)字范圍按位與 :https://blog.csdn.net/gjh13/article/details/90733575?難度:中等
Leetcode 260. 只出現(xiàn)一次的數(shù)字 III:https://blog.csdn.net/gjh13/article/details/90734039?難度:中等
?
第六部分:樹
2019-06-02
Leetcode 100. 相同的樹:https://blog.csdn.net/gjh13/article/details/90737664?難度:簡(jiǎn)單
Leetcode 101. 對(duì)稱二叉樹:https://blog.csdn.net/gjh13/article/details/90737952?難度:簡(jiǎn)單
Leetcode 104. 二叉樹的最大深度:https://blog.csdn.net/gjh13/article/details/90738048?難度:簡(jiǎn)單
Leetcode 107. 二叉樹的層次遍歷 II:https://blog.csdn.net/gjh13/article/details/90740002?難度:簡(jiǎn)單
Leetcode 257. 二叉樹的所有路徑:https://blog.csdn.net/gjh13/article/details/90742767?難度:簡(jiǎn)單
?
2019-06-13
Leetcode 95. 不同的二叉搜索樹 II:https://blog.csdn.net/gjh13/article/details/91902718?難度:中等
?
2019-06-15
Leetcode 96. 不同的二叉搜索樹:https://blog.csdn.net/gjh13/article/details/92103301?難度:中等
Leetcode 98. 驗(yàn)證二叉搜索樹:https://blog.csdn.net/gjh13/article/details/92109267?難度:中等
Leetcode 102. 二叉樹的層次遍歷:https://blog.csdn.net/gjh13/article/details/92142549?難度:中等
Leetcode 105. 從前序與中序遍歷序列構(gòu)造二叉樹:https://blog.csdn.net/gjh13/article/details/92164684?難度:中等
Leetcode 106. 從中序與后序遍歷序列構(gòu)造二叉樹:https://blog.csdn.net/gjh13/article/details/92178372?難度:中等
Leetcode 113. 路徑總和 II:https://blog.csdn.net/gjh13/article/details/92211700?難度:中等
?
2019-06-23
Leetcode 114. 二叉樹展開為鏈表:https://blog.csdn.net/gjh13/article/details/93405065?難度:中等
Leetcode 116. 填充每個(gè)節(jié)點(diǎn)的下一個(gè)右側(cè)節(jié)點(diǎn)指針:https://blog.csdn.net/gjh13/article/details/93407916?難度:中等
Leetcode 117. 填充每個(gè)節(jié)點(diǎn)的下一個(gè)右側(cè)節(jié)點(diǎn)指針 II:https://blog.csdn.net/gjh13/article/details/93410685?難度:中等
Leetcode 129. 求根到葉子節(jié)點(diǎn)數(shù)字之和:https://blog.csdn.net/gjh13/article/details/93413515?難度:中等
?
2019-06-24
Leetcode 199. 二叉樹的右視圖:https://blog.csdn.net/gjh13/article/details/93536830?難度:中等
?
第七部分:深度優(yōu)先搜索
2019-07-09
Leetcode 109. 有序鏈表轉(zhuǎn)換二叉搜索樹:https://blog.csdn.net/gjh13/article/details/95217506?難度:中等
?
2019-07-10
Leetcode 130. 被圍繞的區(qū)域:https://blog.csdn.net/gjh13/article/details/95315955?難度:中等
Leetcode 133. 克隆圖:https://blog.csdn.net/gjh13/article/details/95331596?難度:中等
Leetcode 200. 島嶼數(shù)量:https://blog.csdn.net/gjh13/article/details/95334898?難度:中等
Leetcode 207. 課程表:https://blog.csdn.net/gjh13/article/details/95343384?難度:中等
Leetcode 210. 課程表 II:https://blog.csdn.net/gjh13/article/details/95392164?難度:中等
?
第八部分:廣度優(yōu)先搜索
2019-07-16
Leetcode 127. 單詞接龍:https://blog.csdn.net/gjh13/article/details/96157719?難度:中等
?
第九部分:設(shè)計(jì)
2019-07-20
Leetcode 146. LRU緩存機(jī)制:https://blog.csdn.net/gjh13/article/details/96589770?難度:中等
?
第十部分:Trie樹
2019-07-20
Leetcode 208. 實(shí)現(xiàn) Trie (前綴樹):https://blog.csdn.net/gjh13/article/details/96603832?難度:中等
?
2019-07-21
Leetcode 211. 添加與搜索單詞 - 數(shù)據(jù)結(jié)構(gòu)設(shè)計(jì):https://blog.csdn.net/gjh13/article/details/96707733?難度:中等
?
第十一部分:遞歸
2019-07-21
Leetcode 698. 劃分為k個(gè)相等的子集:https://blog.csdn.net/gjh13/article/details/96725648?難度:中等
?
第十二部分:腦筋急轉(zhuǎn)彎
2019-07-21
Leetcode 292. Nim 游戲:https://blog.csdn.net/gjh13/article/details/96728691?難度:簡(jiǎn)單
Leetcode 319. 燈泡開關(guān):https://blog.csdn.net/gjh13/article/details/96735882?難度:中等
?
第十三部分:隊(duì)列
2019-07-25
Leetcode 621. 任務(wù)調(diào)度器:https://blog.csdn.net/gjh13/article/details/97243569?難度:中等
Leetcode 622. 設(shè)計(jì)循環(huán)隊(duì)列:https://blog.csdn.net/gjh13/article/details/97250026?難度:中等
?
第十四部分:極小化極大
2019-07-26
Leetcode 375. 猜數(shù)字大小 II:https://blog.csdn.net/gjh13/article/details/97373834?難度:中等
?
第十五部分:蓄水池抽樣
2019-07-26
Leetcode 382. 鏈表隨機(jī)節(jié)點(diǎn):https://blog.csdn.net/gjh13/article/details/97375156?難度:中等
Leetcode 398. 隨機(jī)數(shù)索引:https://blog.csdn.net/gjh13/article/details/97375689?難度:中等
?
第十六部分:幾何
2019-07-26
Leetcode 963. 最小面積矩形 II :https://blog.csdn.net/gjh13/article/details/97392831?難度:中等
?
第十七部分:數(shù)組
2019-07-26
Leetcode 88. 合并兩個(gè)有序數(shù)組:https://blog.csdn.net/gjh13/article/details/97395076?難度:簡(jiǎn)單
Leetcode 167. 兩數(shù)之和 II - 輸入有序數(shù)組:https://blog.csdn.net/gjh13/article/details/97395942?難度:簡(jiǎn)單
Leetcode 189. 旋轉(zhuǎn)數(shù)組:https://blog.csdn.net/gjh13/article/details/97397650?難度:簡(jiǎn)單
?
2019-07-27
Leetcode 217. 存在重復(fù)元素:https://blog.csdn.net/gjh13/article/details/97565931?難度:簡(jiǎn)單
Leetcode 219. 存在重復(fù)元素 II:https://blog.csdn.net/gjh13/article/details/97567988?難度:簡(jiǎn)單
Leetcode 283. 移動(dòng)零:https://blog.csdn.net/gjh13/article/details/97571971?難度:簡(jiǎn)單
?
2019-07-30
Leetcode 90. 子集 II:https://blog.csdn.net/gjh13/article/details/97759146?難度:中等
Leetcode 120. 三角形最小路徑和:https://blog.csdn.net/gjh13/article/details/97763782?難度:中等
Leetcode 152. 乘積最大子序列:https://blog.csdn.net/gjh13/article/details/97790522?難度:中等
Leetcode 153. 尋找旋轉(zhuǎn)排序數(shù)組中的最小值:https://blog.csdn.net/gjh13/article/details/97793603?難度:中等
Leetcode 162. 尋找峰值:https://blog.csdn.net/gjh13/article/details/97795082?難度:中等
Leetcode 209. 長(zhǎng)度最小的子數(shù)組:https://blog.csdn.net/gjh13/article/details/97807712?難度:中等
?
第十八部分:哈希表
2019-08-03
Leetcode 202. 快樂數(shù):https://blog.csdn.net/gjh13/article/details/98316709?難度:簡(jiǎn)單
Leetcode 204. 計(jì)數(shù)質(zhì)數(shù):https://blog.csdn.net/gjh13/article/details/98329825?難度:簡(jiǎn)單
Leetcode 205. 同構(gòu)字符串:https://blog.csdn.net/gjh13/article/details/98335418?難度:簡(jiǎn)單
?
2019-08-14
Leetcode 138. 復(fù)制帶隨機(jī)指針的鏈表:https://blog.csdn.net/gjh13/article/details/99546237?難度:中等
Leetcode 166. 分?jǐn)?shù)到小數(shù):https://blog.csdn.net/gjh13/article/details/99565153?難度:中等
?
第十九部分:鏈表
2019-08-14
Leetcode 141. 環(huán)形鏈表:https://blog.csdn.net/gjh13/article/details/99567282?難度:簡(jiǎn)單
Leetcode 160. 相交鏈表:https://blog.csdn.net/gjh13/article/details/99572361?難度:簡(jiǎn)單
Leetcode 203. 移除鏈表元素:https://blog.csdn.net/gjh13/article/details/99573869?難度:簡(jiǎn)單
Leetcode 206. 反轉(zhuǎn)鏈表:https://blog.csdn.net/gjh13/article/details/99578190?難度:簡(jiǎn)單
?
?
第二十部分:數(shù)學(xué)
2019-08-15
Leetcode 168. Excel表列名稱:https://blog.csdn.net/gjh13/article/details/99648312?難度:簡(jiǎn)單
Leetcode 171. Excel表列序號(hào):https://blog.csdn.net/gjh13/article/details/99649113?難度:簡(jiǎn)單
Leetcode 172. 階乘后的零:https://blog.csdn.net/gjh13/article/details/99663086?難度:簡(jiǎn)單
?
2019-08-20
Leetcode 223. 矩形面積:https://blog.csdn.net/gjh13/article/details/99845686?難度:中等
Leetcode 279. 完全平方數(shù):https://blog.csdn.net/gjh13/article/details/99850668?難度:中等
?
第二十一部分:雙指針
2019-08-20
Leetcode 125. 驗(yàn)證回文串:https://blog.csdn.net/gjh13/article/details/99999440?難度:簡(jiǎn)單
?
2019-08-24
Leetcode 234. 回文鏈表:https://blog.csdn.net/gjh13/article/details/100058585?難度:簡(jiǎn)單
?
第二十二部分:字符串
2019-09-03
Leetcode 344. 反轉(zhuǎn)字符串:https://blog.csdn.net/gjh13/article/details/100528334?難度:簡(jiǎn)單
Leetcode 345. 反轉(zhuǎn)字符串中的元音字母:https://blog.csdn.net/gjh13/article/details/100528591?難度:簡(jiǎn)單
?
?
第二十三部分:二分查找
?
第二十四部分:分治算法
?
第二十五部分:動(dòng)態(tài)規(guī)劃
?
第二十六部分:回溯算法
?
?
?
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的开启LeetCode之路的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Leetcode 232. 用栈实现队列
- 下一篇: 我的机器学习入门之路(上)——传统机器学