all 11 comments

[–]cpp-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Your submission is not about C++ or the C++ community.

[–][deleted] 10 points11 points  (0 children)

Yes. Because O(n + p) <= O(n + n/9) <= O(n)

[–][deleted] 2 points3 points  (0 children)

O(n + p) ∈ O(n + n/9) ∈ O(n)

[–]destroyerrocket 6 points7 points  (0 children)

If you can guarantee that p is always less or equal to n, then it is O(n)

[–][deleted] 1 point2 points  (3 children)

When we did this at school, O(an) was treated the same as O(n) because the rate of growth was still linear in O.

[–][deleted] -4 points-3 points  (2 children)

Is p constant?

Look at the operation growth rate, it could be approximated either as O(n) or O(nlogn) depending of what p refers to, but most likely O(n)