We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3db87a7 commit cd14876Copy full SHA for cd14876
docs/19_python内置常用算法和数据结构/builtins.md
@@ -266,6 +266,7 @@ def maxheapval(h):
266
# lru_cache/cache 优化记忆化搜索
267
268
python3 functools 模块的 cache 功能和 lru_cache(maxsize=None) 一样,不过更加轻量更快。在记忆化递归搜索的时候很方便。
269
+注意这里的参数 `maxsize=None` 一定要设置为 None,否则默认的 maxsize=128。
270
举一个力扣上的例子,如果不加 cache 递归函数因为会大量重复计算直接超时,但是加一个装饰器就可以通过。
271
272
```py
0 commit comments