5Insertion and shell sort
5Insertion and shell sort
Write
function for sorting array of floating point numbers in ascending order using
a) Insertion sort
Shell Sort and display top five scores
def insertion_sort(list1):
value = list1[i]
j=i-1
list1[j + 1] = list1[j]
j -= 1
list1[j + 1] = value
return list1
interval = n // 2
temp = array[i]
j=i
j -= interval
array[j] = temp
interval //= 2
list = []
if (choise == 1):
print("The unsorted list is:", list)
elif (choise==2):
size = len(list)
shellSort(list, size)
else: