Of course, this is O (NV ^ 2), because it means that the code will never be slower than that. Since max (A) = V, you can say that the worst case is when each index A has V. If so, then the complexity can be limited to O (NV * V).
, for k O (avg (A)). , Omega (NV * avg (A)), avg (A) <= V.
- ( ) Theta (NV * O (V)), O (V), , , V, .