Skip to content

Commit b8f0420

Browse files
committed
增加内置数据结构表格
1 parent cb7022e commit b8f0420

File tree

1 file changed

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

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,16 @@
88
- collections
99
- heapq
1010
- bisect
11+
12+
下边我列了一个常用的表格,如果有遗漏可以在 issue 中提出。确保你了解这些数据结构和算法的使用以及时间、空间复杂度。
13+
14+
| 数据结构/算法 | 语言内置 | 内置库 |
15+
|----------------|---------------------------------|---------------------------------------------------------------|
16+
| 线性结构 | list(列表)/tuple(元祖) | array(数组,不常用)/collections.namedtuple |
17+
| 链式结构 | | collections.deque(双端队列) |
18+
| 字典结构 | dict(字典) | collections.Counter(计数器)/OrderedDict(有序字典)/defaultdict |
19+
| 集合结构 | set(集合)/frozenset(不可变集合) | |
20+
| 排序算法 | sorted | |
21+
| 二分算法 | | bisect模块 |
22+
| 堆算法 | | heapq模块 |
23+
| 缓存算法 | | functools.lru_cache(Least Recent Used, python3) |

0 commit comments

Comments
 (0)