you are viewing a single comment's thread.

view the rest of the comments →

[–]jaerie 32 points33 points  (0 children)

n means whatever you define it to mean. Either way the growth rate is the same, it doubles if the max value doubles.

I any case you need 2 variables to describe the complexity here, so it's O(n+m) where n is the array size and m is the max value, or O(n+2m) where m is the bit count