Practice Layer

LeetCode 学习指南

LeetCode is practice, not the curriculum.

低题量原则:通常每周 2–3 题;Hog、Cats、Ants 或 Scheme Interpreter 的 project-heavy weeks,1–2 题或暂停都正常。先在 DSA 页面完成 Learn 与 Implement。

固定训练循环

课程先学概念 ↓ 自己实现最小版本 ↓ 2 × Easy + 1 × Medium ↓ 写复杂度与选择理由 ↓ 3–7 天后复做 1 题

完成一道题的标准

不以“刷够 50 题”为 KPI。更重要的是能解释数据结构选择、time / space complexity,并在 3–7 天后不看旧代码重新写出来。

01 · Array / Hash Table
Two Sumhash map;体会 O(n²) → O(n)
Contains Duplicateset membership
Valid Anagramcounting / hash
02 · Stack / Queue
Valid Parenthesesstack 的经典匹配模型
Min StackADT + invariant
Daily Temperaturesmonotonic stack,可选
03 · Recursion / Backtracking
Reverse String可强制写递归版
Subsetsinclude / exclude 搜索树
Permutationschoose / recurse / unchoose
04 · Linked List / Binary Search
Reverse Linked List指针更新顺序
Merge Two Sorted Listslinked structure
Binary Searchinterval invariant
05 · Heap / Sorting
Kth Largest Elementheap / quickselect
Top K Frequenthash + heap / bucket
Merge Intervalssorting + scan
06 · Tree / BST
Maximum Depth树递归基本型
Invert Binary Treetraversal + recursion
Validate BSTBST invariant
07 · Graph
Flood Fillgraph traversal 入门
Number of Islandsconnected components
Course Scheduledirected cycle / topo
08 · Greedy / Dynamic Programming
Jump Gamegreedy
Climbing Stairsrecursion → memo → bottom-up
House Robber1D DP state