Ответсообщение недоступно
There's a slight difference between insertion sort and bubble sort :
Bubble sort breaks a bubble in every iteration (if there's any).
A bubble is when a number in lower index is greater than a number in higher indexes if u wanna sort the list in ascending order. (Like the if statement in ur code)
However what insertion sort does is that it splits the list into sorted and unsorted parts and for every number in unsorted part it finds its place in the sorted part and inserts it in that index. (Note that by splitting the list into sorted and unsorted parts I dont mean it creats two other lists and puts numbers in them, it split them by initializing a variable that keeps the index.)