Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
()時間アルゴリズムは、(^ 2)時間アルゴリズムよりも常に高速であるとは限りません。
この声明は真実です。誰もが特別な場合を知っていますか?
Just by the definition of O any algorithm in Θ(logn) is also in O(n^2) and is asymptotically faster than an algorithm in Θ(n).
When the constant overhead of the O(n) algorithm is larger than n^2, which happens for small n.
O(n)
n