$$ O(1) $$
The Big O notation for constant time is O(1).
$$ O(log n) $$
The Big O notation for logrithmic time is O(log n).
$$ O(n) $$
The Big O notation for linear time is O(n).
$$ O(nlog n) $$
The Big O notation for quasilinear time is O(nlog n).
Swift
中 sort
方法的时间复杂度。
$$ O(n^2) $$
The Big O notation for quadratic time is O(n^2).
多项式
指数
阶乘
best-case runtime
the same best and worse case