o(1) means constant average memory use, regardless the size of your input. o(n) means if you have n element you are processing, your average memory need grows linear. o(n*n) means if you have n elements you are processing, your average memory need will grow quadratic.
Is O 1 better or O N?
O(1) is faster asymptotically as it is independent of the input. O(1) means that the runtime is independent of the input and it is bounded above by a constant c. O(log n) means that the time grows linearly when the input size n is growing exponentially.
What is O n extra space?
The additional space used can be defined as O(k). “No extra space” implies some amount of space, usually exactly n, is available via the input, and no more should be used, although in an interview I never care if the candidate uses O(1) extra.