Skip to content

drjkuo/leetcode-javascript-python3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

339 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode Solutions & Labuladong Study Plan

Personal LeetCode solutions (mostly JavaScript) with a study plan based on Labuladong's Quick Learning Plan.

目錄 / Table of Contents


繁體中文

Labuladong 速成目錄學習規劃

基於 labuladong.online 速成目錄學習規劃 整理,用於在本倉庫中按框架刷題、追蹤進度。
建議配合 演算法速成路線圖(樹形結構,可展開教程與題單)使用。

使用說明

項目 說明
適合誰 時間緊、要面試/筆試,想先掌握必考框架再刷公司題單
學習節奏 建議每天 1–2 小時;建議用時偏保守,整塊時間學習會更快
學習方法 先讀框架文章 → 再做題單;第一次以理解+模仿為主,不要死磕
本倉庫 做完題後可在根目錄找對應 LeetCode 編號檔案對照或補充解法

核心原則(來自原文)

  1. 先學框架,再刷題單 — 題單用於了解難度/類別和複習,不是入門起點
  2. 統一模板風格 — 學的是解題能力,不是背答案
  3. 先資料結構,再刷題 — 二元樹/遞迴是後續 DFS、回溯、DP 的基礎
  4. 不要跳過框架直接刷題 — 基礎不牢,遇到變體容易卡住

勾選 - [ ] 追蹤進度。框架文章標 核心,習題標 習題


一、資料結構(約 5–7 天)

相對簡單,重點是建立直覺;二元樹與圖是後面刷題的地基。

1.1 陣列 & 鏈表 · 建議 1 天

1.2 環形陣列 · 建議 0.5 天

1.3 佇列 & 堆疊 · 建議 0.5 天

1.4 雜湊表 · 建議 1–2 天

1.5 二元樹基礎及遍歷 · 建議 1–2 天

遞迴思維入門關鍵:後面所有遞迴本質都是二元樹遍歷。

1.6 二元搜尋樹 · 建議 0.5 天

1.7 二元堆 · 建議 0.5 天

1.8 圖結構 · 建議 1 天


二、開始刷題(約 45–60 天)

刷題前可先讀:力扣/LeetCode 解題須知

2.0 總綱 · 建議 0.5 天

2.1 鏈表

類型 建議用時 內容
核心 1 天 雙指標技巧秒殺七道鏈表題目
習題 1 天 鏈表雙指標經典習題
核心 1 天 如何判斷回文鏈表 · 單鏈表的花式反轉方法匯總
  • 雙指標框架
  • 鏈表雙指標習題
  • 回文鏈表 & 反轉匯總

2.2 陣列

類型 建議用時 內容
核心 0.5 天 雙指標技巧秒殺七道陣列題目
習題 1–2 天 二維陣列的花式遍歷技巧 · 陣列雙指標經典習題
核心 1 天 滑動視窗演算法核心程式碼模板
習題 1 天 滑動視窗演算法經典習題
核心 1–2 天 二分搜尋演算法核心程式碼模板 · 實際運用二分搜尋時的思維框架
核心 1–2 天 小而美的演算法技巧:前綴和陣列 · 小而美的演算法技巧:差分陣列
  • 陣列雙指標框架
  • 二維遍歷 & 雙指標習題
  • 滑動視窗框架 & 習題
  • 二分搜尋框架 & 思維框架
  • 前綴和 & 差分陣列

字串題本質上是字元陣列,按陣列套路處理即可。

2.3 佇列 / 堆疊

類型 建議用時 內容
核心 0.5 天 佇列實作堆疊以及堆疊實作佇列
習題 1–2 天 堆疊的經典習題 · 佇列的經典習題
核心 1–2 天 單調堆疊演算法模板解決三道例題 · 單調佇列結構解決滑動視窗問題
習題 1–2 天 單調堆疊的幾種變體及經典習題
  • 堆疊/佇列互實作
  • 堆疊 & 佇列習題
  • 單調堆疊 & 單調佇列框架
  • 單調堆疊習題

2.4 二元樹 & 遞迴思想

窮舉的核心抽象是樹結構。三種思維模式對應後續演算法:遍歷 → DFS/回溯;分解問題 → DP/分治;層序 → BFS。

類型 建議用時 內容
核心 0.5 天 一個視角+兩種思維模式搞定遞迴
核心 1 天 二元樹系列演算法核心綱領 — 先認真讀第一部分
核心 2–3 天 二元樹心法(思路篇) · 構造篇 · 序列化篇
習題 1 天 拓展:最近公共祖先系列解題框架 · 拓展:如何計算完全二元樹的節點數
習題 2 天 用「遍歷」思維解題 I · 用「分解問題」思維解題 I · 運用層序遍歷解題 I
  • 遞迴兩種思維模式
  • 二元樹核心綱領
  • 二元樹心法三篇
  • LCA & 完全二元樹節點數
  • 遍歷/分解/層序 習題 I

2.5 二元搜尋樹 · 建議 2–3 天

2.6 字典樹(Trie)· 建議 1–2 天

2.7 資料結構設計

類型 建議用時 內容
習題 1 天 演算法就像搭樂高:手刻 LRU 演算法 — 必會
習題 1 天 拓展:如何實作一個計算機 — 可儲存模板備用
習題 1 天 更多經典設計習題
  • LRU
  • 計算機(可選儲存程式碼)
  • 更多設計習題

2.8 圖演算法

類型 建議用時 內容
核心 1–2 天 環檢測演算法 · 拓撲排序演算法 · 二分圖判定演算法
核心 1 天 Union Find 併查集原理 · Union-Find 併查集演算法 — 建議儲存 UF 模板
核心 1 天 最小生成樹問題概覽 · Kruskal 最小生成樹演算法
核心 0.5 天 圖結構最短路演算法概覽
核心 1 天 Dijkstra 演算法模板 · Dijkstra 拓展:帶限制的最短路問題 · Dijkstra 演算法習題
  • 環檢測/拓撲排序/二分圖
  • 併查集原理 & 實作
  • 最小生成樹 & Kruskal
  • 最短路概覽
  • Dijkstra 模板 & 習題

2.9 DFS / 回溯演算法

類型 建議用時 內容
核心 1–2 天 回溯演算法解題套路框架 · 回溯演算法實踐:數獨和 N 皇后問題
核心 1–2 天 回溯演算法秒殺所有排列/組合/子集問題
核心 1 天 一文秒殺所有島嶼題目 · 回答 DFS 和回溯演算法的若干疑問
習題 2 天 回溯演算法經典習題 I(時間緊可只做精選題)
  • 回溯框架 & 數獨/N 皇后
  • 排列/組合/子集萬能框架
  • 島嶼 DFS & DFS vs 回溯
  • 回溯習題 I

2.10 BFS 演算法

類型 建議用時 內容
核心 1 天 BFS 演算法解題套路框架
習題 2 天 BFS 經典習題 I · BFS 經典習題 II(時間緊可精選)
  • BFS 框架
  • BFS 習題

2.11 動態規劃

類型 建議用時 內容
核心 1–2 天 動態規劃解題套路框架 · 動態規劃設計:最長遞增子序列
核心 1–2 天 base case 和備忘錄的初始值怎麼定? · 最優子結構原理和 dp 陣列遍歷方向
習題 1–2 天 經典動態規劃:編輯距離 · 動態規劃設計:最大子陣列 · 經典動態規劃:最長公共子序列
習題 1–2 天 經典動態規劃:0-1 背包問題 · 子集背包問題 · 完全背包問題
  • DP 框架 & LIS
  • base case & 遍歷方向
  • 編輯距離/最大子陣列/LCS
  • 三種背包

若目標公司明確不考 DP,可跳過本節,把時間給其他專題。

2.12 貪心演算法 · 建議 1 天

2.13 分治演算法 · 建議 1 天

2.14 數學 · 建議 2–3 天

2.15 其他經典面試題 · 建議 2–4 天

2.16 排序演算法 · 建議 1 天


三、進度總覽

階段 建議用時 完成
一、資料結構 5–7 天
二、刷題總綱 0.5 天
鏈表 3 天
陣列 6–9 天
佇列/堆疊 4–7 天
二元樹 & 遞迴 7–8 天
二元搜尋樹 2–3 天
字典樹 1–2 天
資料結構設計 3 天
圖演算法 5–6 天
DFS/回溯 5–7 天
BFS 3 天
動態規劃 5–8 天
貪心 1 天
分治 1 天
數學 2–3 天
其他經典題 2–4 天
排序 1 天
合計(約) 55–75 天

按每天 1–2 小時估算;整塊時間學習可顯著縮短。


四、本倉庫已有解法(對照參考)

按專題列出部分已存在的本地檔案,刷完對應章節後可回來對照:

專題 本倉庫檔案
雜湊/雙指標 1. Two Sum.js
鏈表 2. Add Two Numbers.js, 206. Reverse Linked List.js
滑動視窗 3. Longest Substring Without Repeating Characters.js, 239. Sliding Window Maximum.js
堆疊 20. Valid Parentheses.js
雙指標/nSum 15. 3Sum.js
回溯 46. Permutations.js, 78. Subsets.js
DFS 島嶼 200. Number of Islands.js, 695. Max Area of Island.js
字典樹 208. Implement Trie (Prefix Tree).js
堆積 215. Kth Largest Element in an Array.js
併查集 547. Friend Circles.js, 721. Accounts Merge.js
設計 380. Insert Delete GetRandom O(1).js, 535. Encode and Decode TinyURL.js
接雨水 42. Trapping Rain Water.js
動態規劃 198. House Robber.js, 64. Minimum Path Sum.js
圖/最短路 787. Cheapest Flights Within K Stops.js

五、學完速成目錄之後

  1. 刷公司題單 — 了解考題難度與類別,並用於複習
  2. 補完整目錄 — 時間充裕可參考 完整目錄學習規劃
  3. 安裝刷題外掛Chrome / VS Code / JetBrains 可在題目頁直接看思路講解

來源:Labuladong《速成目錄學習規劃》,頁面更新於 2026/06/19


English

Labuladong Quick Learning Plan Study Guide

Based on labuladong.online Quick Learning Plan. Use this guide to practice by framework and track progress in this repository.
Pair it with the Algorithm Quick Learning Roadmap (tree view with tutorials and problem lists).

How to Use This Guide

Item Description
Who It's For Short on time, preparing for interviews or coding tests, want to master essential frameworks before company problem lists
Study Pace ~1–2 hours per day; time estimates are conservative — dedicated blocks speed things up
Learning Method Read framework articles first → then problem sets; first pass: understand and imitate, don't grind
This Repository After solving, compare or add solutions using LeetCode-numbered files in the repo root

Core Principles (from the original)

  1. Learn frameworks first, then problem lists — lists are for gauging difficulty/categories and review, not as a starting point
  2. Unified template style — build problem-solving skill, not memorization
  3. Data structures before problems — binary trees and recursion underpin DFS, backtracking, and DP
  4. Don't skip frameworks and jump straight to problems — weak foundations fail on variants

Check off - [ ] items to track progress. Framework articles are marked Core; drills are marked Practice.


Part 1: Data Structures (~5–7 days)

Relatively straightforward — focus on intuition. Binary trees and graphs are the foundation for later problem-solving.

1.1 Arrays & Linked Lists · Suggested 1 day

1.2 Circular Array · Suggested 0.5 day

1.3 Queue & Stack · Suggested 0.5 day

1.4 Hash Table · Suggested 1–2 days

1.5 Binary Tree Basics & Traversal · Suggested 1–2 days

Key to recursive thinking: all recursion is essentially binary tree traversal.

1.6 Binary Search Tree · Suggested 0.5 day

1.7 Binary Heap · Suggested 0.5 day

1.8 Graph Structure · Suggested 1 day


Part 2: Start Solving Problems (~45–60 days)

Before diving in, read: LeetCode Problem-Solving Guide

2.0 Overview · Suggested 0.5 day

2.1 Linked Lists

Type Suggested Time Content
Core 1 day Two-Pointer Techniques: Seven Linked List Problems
Practice 1 day Classic Linked List Two-Pointer Problems
Core 1 day How to Detect a Palindrome Linked List · Creative Ways to Reverse a Singly Linked List
  • Two-pointer framework
  • Linked list two-pointer practice
  • Palindrome linked list & reversal summary

2.2 Arrays

Type Suggested Time Content
Core 0.5 day Two-Pointer Techniques: Seven Array Problems
Practice 1–2 days Creative 2D Array Traversal Techniques · Classic Array Two-Pointer Problems
Core 1 day Sliding Window Algorithm Core Template
Practice 1 day Classic Sliding Window Problems
Core 1–2 days Binary Search Core Template · Mental Framework for Binary Search in Practice
Core 1–2 days Prefix Sum Arrays · Difference Arrays
  • Array two-pointer framework
  • 2D traversal & two-pointer practice
  • Sliding window framework & practice
  • Binary search framework & mental model
  • Prefix sum & difference array

String problems are essentially character arrays — treat them with array techniques.

2.3 Queue / Stack

Type Suggested Time Content
Core 0.5 day Implement Stack with Queue & Queue with Stack
Practice 1–2 days Classic Stack Problems · Classic Queue Problems
Core 1–2 days Monotonic Stack Template: Three Example Problems · Monotonic Queue for Sliding Window Problems
Practice 1–2 days Monotonic Stack Variants & Classic Problems
  • Stack/queue mutual implementation
  • Stack & queue practice
  • Monotonic stack & monotonic queue frameworks
  • Monotonic stack practice

2.4 Binary Trees & Recursion

The core abstraction of brute force is tree structure. Three thinking modes map to later algorithms: traversal → DFS/backtracking; divide & conquer → DP/divide-and-conquer; level-order → BFS.

Type Suggested Time Content
Core 0.5 day One Perspective + Two Thinking Modes to Master Recursion
Core 1 day Binary Tree Algorithm Core Guide — read Part 1 carefully first
Core 2–3 days Binary Tree Mastery (Thinking) · Construction · Serialization
Practice 1 day Extension: Lowest Common Ancestor Framework · Extension: Counting Nodes in a Complete Binary Tree
Practice 2 days Solve with Traversal Thinking I · Solve with Divide-and-Conquer Thinking I · Solve with Level-Order Traversal I
  • Two recursive thinking modes
  • Binary tree core guide
  • Binary tree mastery (three articles)
  • LCA & complete binary tree node count
  • Traversal / divide / level-order practice I

2.5 Binary Search Tree · Suggested 2–3 days

2.6 Trie · Suggested 1–2 days

2.7 Data Structure Design

Type Suggested Time Content
Practice 1 day Build LRU from Scratch — must know
Practice 1 day Extension: How to Build a Calculator — save template for reuse
Practice 1 day More Classic Design Problems
  • LRU
  • Calculator (optional: save template)
  • More design practice

2.8 Graph Algorithms

Type Suggested Time Content
Core 1–2 days Cycle Detection · Topological Sort · Bipartite Graph Detection
Core 1 day Union-Find Principles · Union-Find Algorithm — save UF template
Core 1 day Minimum Spanning Tree Overview · Kruskal's Minimum Spanning Tree Algorithm
Core 0.5 day Shortest Path Algorithms Overview
Core 1 day Dijkstra's Algorithm Template · Dijkstra Extension: Constrained Shortest Path · Dijkstra Practice Problems
  • Cycle detection / topological sort / bipartite graph
  • Union-Find principles & implementation
  • Minimum spanning tree & Kruskal
  • Shortest path overview
  • Dijkstra template & practice

2.9 DFS / Backtracking

Type Suggested Time Content
Core 1–2 days Backtracking Problem-Solving Framework · Backtracking in Practice: Sudoku & N-Queens
Core 1–2 days Master All Permutation / Combination / Subset Problems with Backtracking
Core 1 day Master All Island Problems in One Article · FAQ: DFS vs Backtracking
Practice 2 days Classic Backtracking Problems I (pick essentials if short on time)
  • Backtracking framework & Sudoku/N-Queens
  • Permutation/combination/subset universal framework
  • Island DFS & DFS vs backtracking
  • Backtracking practice I

2.10 BFS Algorithm

Type Suggested Time Content
Core 1 day BFS Problem-Solving Framework
Practice 2 days Classic BFS Problems I · Classic BFS Problems II (pick essentials if short on time)
  • BFS framework
  • BFS practice

2.11 Dynamic Programming

Type Suggested Time Content
Core 1–2 days Dynamic Programming Framework · DP Design: Longest Increasing Subsequence
Core 1–2 days How to Set Base Cases & Memo Initial Values? · Optimal Substructure & DP Array Traversal Direction
Practice 1–2 days Classic DP: Edit Distance · DP Design: Maximum Subarray · Classic DP: Longest Common Subsequence
Practice 1–2 days Classic DP: 0-1 Knapsack · Subset Knapsack · Unbounded Knapsack
  • DP framework & LIS
  • Base case & traversal direction
  • Edit distance / max subarray / LCS
  • Three knapsack variants

If your target company explicitly does not test DP, skip this section and allocate time elsewhere.

2.12 Greedy Algorithm · Suggested 1 day

2.13 Divide and Conquer · Suggested 1 day

2.14 Mathematics · Suggested 2–3 days

2.15 Other Classic Interview Problems · Suggested 2–4 days

2.16 Sorting Algorithms · Suggested 1 day


Part 3: Progress Overview

Phase Suggested Time Done
Part 1: Data Structures 5–7 days
Problem-solving overview 0.5 day
Linked lists 3 days
Arrays 6–9 days
Queue / Stack 4–7 days
Binary trees & recursion 7–8 days
Binary search tree 2–3 days
Trie 1–2 days
Data structure design 3 days
Graph algorithms 5–6 days
DFS / Backtracking 5–7 days
BFS 3 days
Dynamic programming 5–8 days
Greedy 1 day
Divide and conquer 1 day
Mathematics 2–3 days
Other classic problems 2–4 days
Sorting 1 day
Total (approx.) 55–75 days

Estimated at 1–2 hours per day; dedicated study blocks can significantly shorten the timeline.


Part 4: Existing Solutions in This Repository

Local files to compare after completing each section:

Topic Local Files
Hash table / two pointers 1. Two Sum.js
Linked lists 2. Add Two Numbers.js, 206. Reverse Linked List.js
Sliding window 3. Longest Substring Without Repeating Characters.js, 239. Sliding Window Maximum.js
Stack 20. Valid Parentheses.js
Two pointers / nSum 15. 3Sum.js
Backtracking 46. Permutations.js, 78. Subsets.js
DFS islands 200. Number of Islands.js, 695. Max Area of Island.js
Trie 208. Implement Trie (Prefix Tree).js
Heap 215. Kth Largest Element in an Array.js
Union-Find 547. Friend Circles.js, 721. Accounts Merge.js
Design 380. Insert Delete GetRandom O(1).js, 535. Encode and Decode TinyURL.js
Trapping rain water 42. Trapping Rain Water.js
Dynamic programming 198. House Robber.js, 64. Minimum Path Sum.js
Graph / shortest path 787. Cheapest Flights Within K Stops.js

Part 5: After Completing the Quick Learning Plan

  1. Company problem lists — gauge difficulty and categories; use for review
  2. Full curriculum — see Complete Learning Plan if you have more time
  3. Install practice pluginsChrome / VS Code / JetBrains for in-page solution walkthroughs

Source: Labuladong "Quick Learning Plan" — page last updated 2026/06/19

About

Leetcode answers in Javascript + practices in Python3

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages