Big O(大 O 记号):用于描述算法或函数在输入规模增大时的增长上界(常指时间复杂度或空间复杂度),强调“规模趋于无穷大时的主要增长趋势”,忽略常数与低阶项。也常泛指“复杂度等级”(如 *O(n)、O(n log n)、O(n²)*)。
/ˌbɪɡ ˈoʊ/
Big O helps me estimate how fast an algorithm is.
Big O 帮助我估算一个算法有多快。
Although both solutions work, the second one has better Big O behavior as the dataset grows, because it runs in O(n log n) instead of O(n²).
虽然两种方案都能用,但当数据集变大时,第二种方案的 Big O 表现更好,因为它是 O(n log n) 而不是 O(n²)。
Big O 来自数学中的Landau 记号(Landau notation),由德国数学家 Edmund Landau 推广,用字母 O 表示“数量级/阶(order)”的上界概念。后来在计算机科学中被广泛用于刻画算法复杂度,因此常以 “Big O” 的称呼出现。