Mar-27-2020, 10:24 AM
excuse me, i wanna ask.
how to change this code into 2Dimension insertionsort code?
my teacher said it only replace 1 line code
i have to change it into 2dimension insertionsort code
how to change this code into 2Dimension insertionsort code?
my teacher said it only replace 1 line code
def insertionSort2D(arr): for i in range(1, len(arr)): key = arr[i] j=i-1 while j>=0 and key<arr[j][0]: arr[j+1]=arr[j] j=j-1 arr[j+1]=key print(arr)this is not an insertionsort 2Dimension code.
i have to change it into 2dimension insertionsort code