Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Insertion sort
#python 3.5.2 def insertion():# main algorithm of insertion sort for j in range(1,len(A)): temp=A[j] i=j-1 while temp<A[i] and i>-1: A[i+1]=A[i] i-=1 A[i+1]=temp def printarray(): # to print status of array for k in range(len(A)): print(A[k],end=' ') print('\n') #A = input array A=[-80,60,40,0,11,-78,-190,-1464264364142,12462361241] printarray()# status of array before sorting insertion()#calling insertion function printarray()# status of array after sorting
run
|
edit
|
history
|
help
0
Lesson4
Python3
Ozan Taşdemir 9/B 499
LinkedList implementation
Lab_I_1_25_11_2020
Converion of dictionary to list of tuples (Stackoverflow problem)
75
DuckTyping.py
number factor memoised
Lab_III_2_01_12_2020