Skip to content

Commit 9a1ad71

Browse files
committed
python3 functools.lru_cache and functools.cache
1 parent b5e517f commit 9a1ad71

File tree

1 file changed

+1
-0
lines changed
  • docs/19_python内置常用算法和数据结构

1 file changed

+1
-0
lines changed

docs/19_python内置常用算法和数据结构/builtins.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
引用的同一个 list,修改一个都会变
3434
- python在数值范围建议用:`MAXINT = 2**63-1; MININT = -2**63` 。因为 python2 sys.maxint 和 python3 sys.maxsize 不统一
3535
- 优先级队列:使用内置的 heapq ,定义一个 Item 类实现"小于" 魔术方法就可以实现
36+
- python3 的 functools 模块自带了 cache(等价于lru_cache(maxsize=None)) 和 lru_cache 装饰器,在一些需要递归记忆化搜索的时候会很方便
3637

3738

3839
# 链表题目调试函数

0 commit comments

Comments
 (0)