Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit beb0d85

Browse files
committed
修复和优化语句表述
1 parent 8630e96 commit beb0d85

File tree

6 files changed

+721
-610
lines changed

6 files changed

+721
-610
lines changed

‎docs/07_algorithm/07_01_enumeration_algorithm.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@ class Solution:
203203
- **时间复杂度**:$O(n^2)$。
204204
- **空间复杂度**:$O(1)$。
205205

206+
## 4. 总结
207+
208+
枚举算法通过遍历所有可能状态来寻找解,优点是实现简单、思路直接、正确性易于验证;缺点是在问题规模增大时时间开销迅速上升,往往无法满足效率要求。
209+
210+
它适用于规模较小、可快速验证答案的问题,或作为基线方案、结果校验与对拍工具。实战中应尽量结合剪枝(添加约束、提前判定不可能)、缩小搜索空间(利用对称性、边界与不变量)、降维与变量替换、以及避免重复计算等手段,显著提升效率。
211+
212+
实践建议是:先写出「能过的暴力正确解」,再围绕「减分支、减范围、减重算」迭代优化;当复杂度仍难以接受时,考虑切换到更合适的范式,例如哈希加速、双指针与滑动窗口、二分查找、分治、动态规划或图算法等。
213+
206214
## 练习题目
207215

208216
- [0001. 两数之和](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0001-0099/two-sum.md)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /