1

I have someone homework to make and in the instructions it says that we need to implement a function in O(1).

Now, does it mean that I can make my function in O(5) or O(2) or whatever?

gnat
  • 21,442
  • 29
  • 112
  • 288

1 Answers1

2

Yes, O(5) is the same thing as O(1). If you've been asked to implement a function in O(1) time, it means it needs to run in the same amount of time no matter how large the data being provided to it is.

8bittree
  • 5,637
  • 3
  • 27
  • 37
Winston Ewert
  • 24,732
  • 12
  • 72
  • 103