def mysort1(x):
y = list(x)
y.sort()
z = [0]*len(y)
for i in range(0, len(y)):
z[i] = y[i]
return z
def mysort2(x):
y = list(x)
y.sort()
z = []
for i in range(0, len(y)):
z.insert(0,y[len(y)-i-1])
return z
I think both of them have a linear time complexity, considering the loop runs n times in both the methods. What do you think is the time complexity of the code blocks given below.