diff --git a/Sort comparison b/Sort comparison new file mode 100644 index 0000000..fd6e4b6 --- /dev/null +++ b/Sort comparison @@ -0,0 +1,38 @@ +#Bubble Sort +def bubble_sort(a): + for x in range(0,len(a)-1): + for y in range(0,len(a)-1-x): + if a[y]>a[y+1]: + a[y],a[y+1]=a[y+1],a[y] + return a +def insertion_sort(a): + for x in range(1,len(a)): + tmp=a[x] + for y in range(x-1,-2,-1): + if tmp