5 ms·
Setting n=1 to say your O(n) is actually O(1) makes no sense because big O notation tells us how the time/space grow as function of the input size. If n=1, inpu
by okl 3y ago
Setting n=1 to say your O(n) is actually O(1) makes no sense because big O notation tells us how the time/space grow as function of the input size. If n=1, input size is fixed.
- burntsushi 3y agoThat's not what is happening here. The n cannot grow because the representation is fixed. Read the links I've provided. The convention and meaning are clear here.