Is this technically an O(1) algorithm for “Hello World”?

Big O notation in this context is being used to describe a relationship between the size of the input of a function and the number of operations that need to be performed to compute the result for that input.

Your operation has no input that the output can be related to, so using Big O notation is nonsensical. The time that the operation takes is independent of the inputs of the operation (which is…none). Since there is no relationship between the input and the number of operations performed, you can’t use Big O to describe that non-existent relationship

Leave a Comment

tech