Тёмный

Intro to Sorting Algorithms in Python - Bubble Sort 

Real Python
Подписаться 190 тыс.
Просмотров 12 тыс.
50% 1

Bubble Sort is one of the most straightforward sorting algorithms. Its name comes from the way the algorithm works: With every new pass, the largest element in the list “bubbles up” toward its correct position.
Bubble sort consists of making multiple passes through a list, comparing elements one by one, and swapping adjacent items that are out of order.
Click here to learn more: realpython.com/courses/intro-...

Опубликовано:

 

20 янв 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 10   
@DevOpsJourney
@DevOpsJourney 3 года назад
Understanding how to program sort algorithms is really good for people learning python or those going for a Developer interview where they ask python questions. Asking to program a sort method is a pretty common interview question.
@strategy_gal
@strategy_gal 3 года назад
Haha - true. My hubby just had a FB coding interview where he said he had do this sort of thing but with C ++
@henrybernreuter4408
@henrybernreuter4408 3 года назад
Best explanation I have ever seen
@GeoPoly55
@GeoPoly55 3 года назад
We need more videos on algorithm
@strategy_gal
@strategy_gal 3 года назад
Hey Dan, I love what you're doing with your community!! Way to go :)
@bluesdog88
@bluesdog88 3 года назад
So "for i in items" the i refers to indices? Oh my god I finally get it, thank you! They couldn't even explain it in college when I kept asking about it lol
@sprajosh
@sprajosh 3 года назад
if you do "for i in items", you're essentially iterating over the list "items" and you'll get one value from the list "item" in "i" for each iteration to get the indices, you can do "for i in range(len(items))" which - for easier understanding - gets the length of your list "item" and creates a list of values from 0 to length of items-1
@bluesdog88
@bluesdog88 3 года назад
@@sprajosh Thanks for the clarification! Appreciate it
@hamiltonbryan441
@hamiltonbryan441 3 года назад
Hey everyone, I tried using the timing decorator and it returns rather than a time. The files timing.py and bubblesort.py are in the same folder. Any ideas as to why the thus would be the case? Thanks! Edit: I got it.. mistyped the code in timing.py 😅
@Raj-uz9nv
@Raj-uz9nv 3 года назад
Other Data structure algorithm video
Далее
Merge Sort In Python Explained (With Example And Code)
13:35
МНЕ ИСПОРТИЛИ МАШИНУ #shorts
00:30
Просмотров 713 тыс.
Epic Reactions 😂
00:33
Просмотров 2,3 млн
My Puzzle Robot is 200x Faster Than a Human
21:21
Просмотров 3,3 млн
Python eval() - Evaluate Expressions Dynamically
14:02
5 Tips To Write Better Python Functions
15:59
Просмотров 96 тыс.
This Is Why Python Data Classes Are Awesome
22:19
Просмотров 795 тыс.
5 Uncommon Python Features I Love
15:09
Просмотров 137 тыс.
How Fast is Python's Sort? Performance Testing
13:15
Просмотров 41 тыс.
Bubble Sort in Plain English
11:35
Просмотров 164 тыс.
Defining Functions in Python
27:54
Просмотров 9 тыс.
МНЕ ИСПОРТИЛИ МАШИНУ #shorts
00:30
Просмотров 713 тыс.