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,213
  • 29
  • 113
  • 291

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,656
Winston Ewert
  • 24,862