Apr-20-2020, 12:18 PM
how to sort an array without using sort function?
I have the code please tell me what is the error in this code
I have the code please tell me what is the error in this code
x = [] n = input("enter length") for i in range(int(n)): k = input("enter value") x.append(k) print(x) for j in range(1,len(x)): k=x[j] i=j-1 while (i>0 and x[i]>k): x[i+1]=x[i] i=i-1 x[i+1]=k print(x)