aboutsummaryrefslogtreecommitdiff
path: root/comparison/Python/isort-40000.py
diff options
context:
space:
mode:
Diffstat (limited to 'comparison/Python/isort-40000.py')
-rw-r--r--comparison/Python/isort-40000.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/comparison/Python/isort-40000.py b/comparison/Python/isort-40000.py
new file mode 100644
index 0000000..6fbadb7
--- /dev/null
+++ b/comparison/Python/isort-40000.py
@@ -0,0 +1,24 @@
+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)
+
+