下面Python代码的平均时间复杂度是( )。
def gcd(N,M):
return N if M ==0 else gcd(M,N % M)
O(N)
O(logN)
O(N log N)
O(N 2)