-1
我有一个关于渐近时间复杂度的快速问题。下面这个函数的时间复杂度(大O)是什么?根据我的理解,它似乎是无限的递归,因此,这将是什么大O符号?时间复杂度无限递归
def asymptoticTest (int1, int2):
if int1 < int2:
asymptoticTest(int1 + 1, int2)
elif int1 > int2:
asymptoticTest(int1 - 1, int2)
else:
asymptoticTest(int2, int1)
O(无穷远)?类似于http://stackoverflow.com/questions/5627390/o-notation-o%E2%88%9E-o1 –
在CS Stackexchange上可能有更好的答案,例如http://cs.stackexchange.com/questions/56556/complexity-analysis-of-an-unsolvable-algorithmic-problem – Brandin