Bubble Sort algorithm implementation in Python

preview_player
Показать описание
Learn about Bubble Sort and how to write a Bubble Sort algorithm from scratch in Python.

Hope you enjoyed the video!

Check out this code here:

Join my Discord server to chat with me:

Check out some code on my GitHub:

Tweet me something funny on Twitter:

Say hi over at Facebook:

Sincerely,
Engineer Man
Рекомендации по теме
Комментарии
Автор

Came from reddit. Dude, please make more videos, explaining all basic algorithms, using Python!

ruslandoronichev
Автор

I absolutely love your style. I am pretty new to Python, and have found the way you present and teach to undoubtedly be the most effective way I am able to learn. I've not found anywhere else where Python is taught in a 'project' type manner rather than in the functional/syntactic manner we see everywhere else. Not that this is bad, but your technique is class. Thank you.

ReflectingMe
Автор

Python is my language of choice & would love to see more videos from you using this. While I know you're teaching about the bubble sort algorithm, it might also be good to mention that python can natively sort a list with "arr.sort()". Just a gee-wiz thing. And I didn't know about that cool little swap you did with "arr[i], arr[i+1] = arr[i+1], arr[i]". Very nice.

amlamarra
Автор

Dude, for real! I need more of these videos! I love the way how you explain this.

lillydlc
Автор

Hey Engineering MAN, Can you please upload more videos on Python starting from basic to Advance.

shailendrakunwar
Автор

Thanks a bunch eMan. Your videos are really helpful

NNNedlog
Автор

def sort(arr):
size = len(arr)
end = size - 1
corrected = True
while end >= 1 and corrected:
corrected = False
for i in range(0, end):
if arr[i] > arr[i+1]:
arr[i], arr[i+1] = arr[i+1], arr[i]
corrected = True
end = end -1 #the last element is at the correct position, it is the max of all elements of array before its index.
#We sort a smaller and smaller array at each turn of the loop. O(N²/2)
return arr

ArgAur
Автор

Hey engineer man, I was wondering if you could do a video on drawing complex structures and/or graphs using loops and/or arrays! Nice video btw! Thanks!
:D

maxwamsley
Автор

for the print sort, I get statements must be separated by newlines or semicolons. Any help? thanks

Samouraimoh
Автор

Impressive channel, should produce more videos!

estilen
Автор

Thanks can you please do kore of these algorithm videos

tanayp
Автор

Hey Engineer Man, I have a challenge for you:
- the bucket challenge -
let's say you have 4 buckets,
bucket 1 = 7
bucket 2 = 4
bucket 3 = 8
bucket 4 = 3

you have to develop something that can fill from one bucket to another in a decreasing way to have the maximum of buckets with a value of 10.

you take out the second bucket to complete the first, then the third to complete the second, and so on.

for the result to be:
bucket 1 = 10
bucket 2 = 10
bucket 3 = 0
bucket 4 = 2

fredpurri
Автор

Please try to do a video on Merge sort. I find that one a tad bit hard to grasp.

CodingMazaa
Автор

Can you open an external file and sort, perhaps a names list alphabetically or a list of phone numbers/serials numerically?

smudgepost
Автор

I know a couple of things about programming (nowhere near being a pro since in my studies I was taught half a year this, half a year that (and so on) - without Google to look stuff up I can do very little), but Python was totally new to me (well, I've never written any and looked through about two Python scripts before today).
Today I watched your Python Basics series and decided to do a bit more. I thought this looked interesting, but after clicking on it I thought "Wait, can I do this myself?". The Bubble Sort is something I haven't written before, so new language and new algorithm!
And sooo... it took me a quite a bit longer than this video (which I haven't watched yet, but will soon) (but less than an hour, I believe, even with doing more than the bare minimum: a) I had to look up how to check the input and discard anything not a number b) I had to look up how to translate the output so there aren't brackets or commata, because I believe outputting stuff in a format the script can't parse is bad form), but I've gotten it right!

Althemor
Автор

what kind of sort does python uses inbuilt in clauses like List.Sort()

SusiEzhil
Автор

Hey engineerman, i really like your videos. Is it possible to make videos on CTF and reverse engineering? Thanks in advance

krebsandme
Автор

Who else wanted to see the time consumption with longer lists? :(

EnglishRain
Автор

what’s the editor that you are using? looks neat.

kafka-
Автор

Can you make more videos about python please..

londonistanbul