「dictはO(1)」は幻想だった — Pythonの辞書とセットが二乗時間に化ける条件をエンジニアが実証
DRANK

9月3日、Daniel Lemireが「Python sets and dictionaries can have quadratic-time performance」と題した記事を公開した。PythonのsetとdictがO(1)という常識に反して、二乗時間(O(n²))や非定数時間の挙動を示す具体的なケースを実測データとともに示したものだ。

by @tf_official
Related Topics: Python Software Design