#Time complexity

13 messages · Page 1 of 1 (latest)

upper foxBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

pine pond
#

The time complexity is O(1) because both loops will be optimized away because they do nothing

pine pond
#

The time complexity of this is not O(log(log(n)))

#

It is O(log(n) * log(m))

novel sedge
pine pond
#

It isn't O(log^2(n)) either

#

Well, now it is since you edited it again

novel sedge
pine pond
#

To understand why, answer two questions:
How many times does the outer loop run?
How many times does the inner loop run?

pine pond