ChatCrawlerпоиск по публичному Telegram Открыть приложение
3

30 Days Of Python

7 сентября 2022
2022-09-07×
7 сентября 2022
k = [5,9,2,7,8,4,3] for i in range(len(k)): for j in range(i+1,len(k)): if k[i]>k[j] : k[i],k[j]= k[j],k[i] print(k)
М
id 1353347414ohh.....how to run then insertion sort..?
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.)
Фотография
нажмите — покажем
Someone can help me with 3(i)
R
Need help for 3rd one
Календарь: сентябрь 2022
Архив по месяцам
Открыть в Telegram Каталог площадок Искать в ChatCrawler

Слепок открытой публичной ленты из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Чего мы не делаем · Убрать страницу из выдачи · Каталог