What\'s the correct big O notation for an algorithm that runs in triangular time? Here\'s an example:
func(x): for i in 0..x for j in 0..i do_som
Yeah, O(n^2) is definitly correct. If I recall correctly, O is anyway always an upper bound, so O(n^3) should IMO also be correct, as would O(n^n) or whatever. However O(n^2) seems to be the most tight one that is easily deductable.
O(n^2)
O(n^3)
O(n^n)