def permutation(str): #str = string input
if len(str) == 0:
return [""]
result = []
for i, char in enumerate(str):
for p in permutation(str[:i] + str[i + 1 :]):
result.append(char + p)
return result
I am confused in asymptotic analysis (time complexity) in this code does it have an O(n!) or O(n*n!) because the recursive call is in the loop. I am still confused does the big O notation only based on regular notation like logarithmic, linear, quadratic, exponential, factorial, etc. Or could beyond that like a combination not only based on the regular notation
I already tried to calculate it and see some explanation in youtube but still couldn't understand well.