3 ms·
No, it's best-case O(1), worst-case O(n) (technically O(1) since there is a constant upper-bound, but let's pretend you said it's O(n) when length is divisible
by TheCoelacanth 8y ago
No, it's best-case O(1), worst-case O(n) (technically O(1) since there is a constant upper-bound, but let's pretend you said it's O(n) when length is divisible by 50 instead of equal to 50) and average-case O(1).
Each of those functions has its own big O, without specifying which function you are talking about big O isn't meaningful.
- deleted 8y ago[deleted]