what does O(N) mean [duplicate]

The comment was referring to the Big-O Notation.

Briefly:

  1. O(1) means in constant time – independent of the number of items.
  2. O(N) means in proportion to the number of items.
  3. O(log N) means a time proportional to log(N)

Basically any ‘O’ notation means an operation will take time up to a maximum of k*f(N)
where:

k is a constant multiplier

f() is a function that depends on N

Leave a Comment