Python 中 list、tuple、set、dict、deque、heapq 的时间复杂度?

一句话速记:list 尾部操作 O(1)、头部 O(n);set/dict 查找 O(1);deque 两端 O(1);heapq 入堆出堆 O(log n)。

Python

同章节的其他八股