-1
나는 점근 시간의 복잡성에 관해 빠른 질문을 가지고 있습니다. 이 함수의 시간 복잡도 (big 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-solsolveable-algorithmic-problem – Brandin