242,177 views
30 votes
30 votes
True or False? O(1) is called constant time.

User ViktorZ
by
2.1k points

2 Answers

18 votes
18 votes
Your mom cuz it’s your mom
User Holdenlee
by
3.0k points
16 votes
16 votes

Answer:

True

Step-by-step explanation:

The notation O(n), pronounced big-O of n is an indication of the complexity of an algorithm. It is an indication of the relationship between the processing time and size of input

So O(n) means the time - input relationship is linear. If it takes x time units to process an input of size y then it will take 5x units to process an input of size 5y

O(1) means the time to process is independent of size. It is always constant. For example in computer algorithms, the time to access a value in an array of values is independent of the size of the array because arrays are indexed and access time for any element of the array is the same

O(n²) means that the time taken varies as the square of the input size

and so on

User Smartrahat
by
3.1k points