Modify the original Insertion Sort code shown below so that itwill print out the length of the list, total number of comparisons,and total number of swaps needed to sort the list given.
def compare(data, a, b): “””Returns True if element at index a > element at index b””” return data[a] > data[b]def swap(data, a, b): “””Swaps the element at index a with element at index b””” data[a], data[b] = data[b], data[a]def insertion_sort(data): “””Sorts the list into ascending order””” for index in range(1, len(data)):
PayPal Gateway not configured
PayPal Gateway not configured