aboutsummaryrefslogtreecommitdiff
path: root/comparison/Python/isort-40000.py
blob: 0bfc577104bef7b83ed1c7d54a3230e3f122f7fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import random

def insert_sort(arr):
    for i in range(1, len(arr)):
        j = i - 1
        ele = arr[i]
        while arr[j] > ele and j >= 0:
            arr[j + 1] = arr[j]
            j -= 1
        arr[j + 1] = ele
    return arr


def mkRandList(n):
    a=[]
    for i in range(1,n+1):
        a.insert(0, random.randint(0,10000))
    return a

a = mkRandList(40000)
insert_sort(a)
#print(a)