Bubble Sort in Plain English
Learn to implement the Bubble Sort algorithm and ace your coding interview.
👍Subscribe for more data structure and algorithm tutorials like this: goo.gl/6PYaGF
🚀Get the full data structures and algorithms course: bit.ly/2YfL3zr
CONNECT WITH ME
My Courses: codewithmosh.com
My Blog: programmingwithmosh.com
My Facebook: / programmingwithmosh
My Twitter: / moshhamedani
Data Structures and Algorithms is an essential topic taught to computer science and software engineering students to help them learn logical thinking and problem solving. That's why a lot of companies these days ask data structure and algorithm questions in their interviews. Sorting algorithms are particularly important. Even though you never have to implement a sorting algorithm in real life, studying and understanding these algorithms help you become better solving larger, more complex problems.
Пікірлер: 173
Thanks Mosh, these topics are helpful for a quick look before any job interview, data structure is very common topic in any CS related job interview, I can still remember that I was asked about Bubble Sort in an interview, and to explain the complexity. Happy to see you code in Java.
@vikramsapate8703
3 жыл бұрын
@@programmingwithmosh I searched Mosh Hamedani on LinkedIn but I didn't find you.
@user-ze6uv7qq5d
Жыл бұрын
Questions can come in⬆️.
OMG I haven't heard of the Bubble Sort since college in '92!
Just completed your course from Udemy and I'm in love with the way of your teaching! So glad you have a KZread channel!
thank you Mosh. It has been a great pleasure to learn from you in youtube and udemy. You are a great teacher. You make complex things so easier, I am grateful to you.
I’m a C# dev and I am just shocked at how similar Java is to C#. It is literally 95% the same syntactically! I guess I know Java now 😂
Thanks, Mosh! This is a fantastic video that helps me understand how it is really working! I understand the bubble sort from the book, but I never knew how to code without your video!
Best experienced instructor ever!!!
This was a great one Mosh, we can't thank you enough for what you do.
Only if KZread were filled with such good content, it would be paradise for IT students. Your approach to teach is just beautiful. I need to ask this to you @Mosh: "Your opinion on PHP programming language" Thanks!
nice optimization. We also love to hear atleast one use case where it can be used practically other than in exams or interviews.
I had no clue you could declare variables inside your for loop. That's awesome.
Thank you Professor Mosh Hamedani for the tutorials. If I were able to take your courses I would definitely grab the chances to do your coursrs.
mosh is one among the best instructors
@savage8441
3 жыл бұрын
he is the best
@Jitsandcrypto
3 жыл бұрын
facts
@devendrakumargupta9021
3 жыл бұрын
Bro where are you from?
@alestoraldous7036
3 жыл бұрын
@@devendrakumargupta9021 Im from Kerala
Mosh you are professional. You make a Quality base video in less earning 💰 . THANK YOU .
The best programmer and instructor I’ve ever seen!
The sort of sort I was so confused about! Thanks Mosh!
Glad you optimised at the end there. Nice vid, thanks.
Your are the best sir, and I got this feeling when I first saw your python course for beginners approximately 3 years ago.
I love your teaching .sir pls make a video on how to think for the soln of any given programming problem.
Mosh thank you for more courses am a fan
I'm currently taking your react native course.. you're just the best
@feranmiafrica9528
3 жыл бұрын
@@programmingwithmosh of course I always do
@KodiLearn
3 жыл бұрын
@@programmingwithmosh Please create separate django course.
I have done your 6 hour python course and other 2 too. You are the best teacher i have ever seen in my life.Hats off to you.May you see my comment. I have a ❓ My django site was not found, when i cannot find it, when searched it through another mobile It said"error 404"
thank you for these incredible videos , you helped me in python and C sharp but i was wondering if you can do a video about data structure and algorithm in C++ hope you read this comment
Mosh u r the best among all . u r the only instructor. who teaches like that. thank u.
@manid8302
3 жыл бұрын
I think telusko is much better.. But also mosh is not bad
Mosh gave me the motivation to try my own luck in being an instructor on my KZread Channel. I wish I will have his calmness and perfect explaining skills just as he does. Lots of love Mosh
Thank you mosh for this awesome explanation
If only I had full access to his courses!
Wow... That's brilliant. Using array.length - i
You are the best one mr.mosh, the one of people who I want to be like is you, tnx a lot from your teachs.🤗
Hello sir . First of all thank you very much for your tutorial courses, I learnt a lot from them and you are one of the best instructor . Sir, can make a tutorial course on machine learning or a complete stack on data science.
I really enjoyed this Mosh, thanks!
Great video on Bubble Sort! Super instructive 👊
I wish my coding teacher explained it like that :) Nice one!
Very clear and understandable.
You are amazing, I have watched and completed all of your courses. I think you are the best programmer in the world
@xxwolf_gamezxx3358
3 жыл бұрын
I have shared all of your videos, you are my role model (for programming)!
you are the best sir
I was really stuck on second iteration.....and this video saved my brain..... Thanks... :?
Sir you are god level in programming.
Awesome 🎉
Thanks very much!
great explanation
Please make a full tutorial on flutter programming. We really really waiting for that tutorial from a best tutor.
Hi Mosh! Thanks for the brief and clear explanation. But I would like to suggest to use JS instead of Java. because it more general + everybody can use it even in his browser and easy to understand 😉 however, you are amazing & kardorost😎
really understandable
Thanks Mosh
Mosh has got a million dollar Smile. Just by looking at him smile makes me very happy even in my toughest of times.
Thanks a lot ! You explained it in just 11 minutes and saved me 💙💙💙💙
@user-ze6uv7qq5d
Жыл бұрын
Questions can come in⬆️.
Thanks
Brilliant video, amazing teacher so far I found for teaching programming techniques
@KodiLearn
3 жыл бұрын
@@programmingwithmosh Please mosh create separate django course.
Mosh when will we get Android development tutorial. Please 😭 (it's been years)
Yes, we need more of the algorithms lectures
@averageguy985
3 жыл бұрын
@@programmingwithmosh already did, with my entire friends circle ☺️ thank you so much for sharing your knowledge and experience with us ☺️
@KodiLearn
3 жыл бұрын
@@programmingwithmosh Please create separate django course. Please Mosh.
Thank youuuu
Your are the beast teacher i am of 14 and from India I learn python with the help of you thankyou for help you are the beast instructer i make some programme with the help of you python corsethankyou very much and losts of love from India 🇮🇳🇮🇳
@nishantrohilla5058
3 жыл бұрын
Thankyou for teaching us python 😍
thank you.
for people trying to do in python : ``` def bubble(arr): n = len(arr) def swap(arr, i, j): arr[i], arr[j] = arr[j], arr[i] # print('=>', arr, end=' ') for i in range(n - 1): for j in range(abs(i - n) - 1): if arr[j] > arr[j + 1]: swap(arr, j, j + 1) # print('j = ' + str(j)) return arr ``` hope it helps.
Hey Mosh , ur comment about this logic, void bubble(int[] arr) { int arrLength = arr.length; int maxSwapIndex = 0; while (arrLength > 0) { maxSwapIndex = 0; for (int i = 1; i if (arr[i - 1] > arr[i]) { swap(arr, i - 1, i); maxSwapIndex = i; } } arrLength = maxSwapIndex; } }
i reallly wanted to take your course ,, but actually its alot expensive for me to enroll now😶may be I have to look for some other alternative to learn data structures and algorithm
you are the best instructor has ever seen 💚
@alimohmed9630
3 жыл бұрын
@@programmingwithmosh Your welcome 💚
I love it when mosh uploads
@discreet_boson
3 жыл бұрын
👍🏼
Sir ur tutorials are amazing plz make a one video on Django plz sir
Time for bubble sort! Waiting!!
@grandmastergyorogyoro532
3 жыл бұрын
@@programmingwithmosh I liked your explanation,it was easy to grasp, Thank.you for the wonderful explanation ✌️
Hi mosh this is Arif Billah from bangladesh. Youre my true mentor thank you so much
@munjir
3 жыл бұрын
vai cse te poren??
@arifbillahsheikh9452
3 жыл бұрын
I am a front end web developer now I am learning back end web development by using python Django. I would like to be a professional software engineer. Mosh is one of my best teacher.
@muhammadfaraz8569
3 жыл бұрын
@@arifbillahsheikh9452 Salam bahi form which vadio you learn web development in Python.
@arifbillahsheikh9452
3 жыл бұрын
you can go to playlist of this channel you will see 6 hours python cousre .
Sensei, You are awesome!! :-)
Hi, do you think your gonna make the other parts of the java course series like intermediate
Thanks for this
@sahilaujla8182
3 жыл бұрын
@@programmingwithmosh sure sir
you just made it more complez
I am proud of myself i menage to make my own sorting algoritham tonight and i didnt even knowing of bubble sort, i write it in c++ and after that asked in discord and actually find out that is my program actually bubble sort
Sir, I'm your student from Pakistan I love your videos so much sir the reason for my texting you is a request that can you please upload tutorial about web scraping with python i watch many videos on youtube but your method of teaching was too good i really loved it can you please do that for your students
How do you edit your videos? please :D they are really cool
Sir, please make whole series on DevOps
Funny how I've basically used the bubble sort algorithm my entire life, when mentally sorting lists, without ever knowing there was a name for it
please make a video on link list too on c++
Make more of algorithms and data structures in java . thank you
@ebentee
3 жыл бұрын
You can submit question to him on the post he creat in the community tab. You just have to feel the form with your question
sir in the 16 th line we should give static sir public static void swap(int arr[], int index1, int index2)
thnx
Hi can you please make a vedio of how to use a macbook Pro, complete ( A-Z ) guide , this would help me a lot please
where can i get the part 1 of this series cause am not familiar with time complexity of algorithms??
If we put a boolean status to determine if the array has been swapped, but the array we pass in initially has the first item smaller than the last item, than the status remains unchanged and returns.So if we pass in an array of [0,1,4,3,5] will the first 2 items be compared, seen as "arranged" and return immediately? please point out any flaws in my logic.Im referring to code at 10:13, thanks in advance.
Great tutorial...Can you please explain how in best case scenario we need a single pass? Because even if array is sorted we have to loop through it to know its sorted so O(n) right?
@user-ze6uv7qq5d
Жыл бұрын
Questions can come in⬆️.
i have one question . how to protect passport jwt token ? example if someone get mytoken variable and copy it into other API like Postman or any other he can access fully backed user data .
Please mosh create fully separate django course. I need that. Please mosh I really like your teaching style.
@KodiLearn
3 жыл бұрын
@@programmingwithmosh Thank you so much for your reply. I am waiting for your course
Can you please show a tutorial on how you make your animations
if we have flag about swaped or not - can we get rid of two cycles and do only one cycle until flag is true?
According to your code the scheme you showed at the beginning is wrong. Cuz index i(0) will be compared to each element in the array, then i + 1 after that comparison and so on.
Laravel Complete tutorial please
Saviour is back
Can you do C++ data structures and algorithms????????? Please
reminder on..
I will be coder inshallah sir if you upload advance Python and SQL.
How about if it is descending mosh!
i want to take your course but i can't afford as i'm only a undergraduate student. will you help me regarding this? i will work hard.
When are you going to do a series on Cloud??
@hankur5883
3 жыл бұрын
+++++
@angmathew4377
3 жыл бұрын
++++
@arturshalimov4396
3 жыл бұрын
You could be a bit more polite.
Sir Please provide django tutorial
Aww mero xama jopulu ho❣️❣️❣️❣️❣️
Hello I am looking to start to learn Code, where do I start and what do you recommend i start with first. I see your course on Udemy is that where I should start? Thanks
@KeifusMathews3
3 жыл бұрын
@@programmingwithmosh Okay will start over the weekend, thank you and wish me luck
Hello @ Programming with Mosh can u help me about Bubble sort at Insertion sort?
@user-ze6uv7qq5d
Жыл бұрын
Questions can come in⬆️.
Plz make more videos about phyton plz... Mosh sir.... Plzzz... Make more videos
@nishantrohilla5058
3 жыл бұрын
Mor about class and modules I need to make perfect without any error in my programms plz..... Plz..... 🙏🙏
@Mosh course price is too high $147 . Any discount or coupon available ?
@matthew11092
3 жыл бұрын
Shashank Pandey the course is available for $29 right now
@shashankpandey1019
3 жыл бұрын
@@matthew11092 yuup got it, thank you
Bookmark - 09:13
Thanks as always! I wish I could see those 9 people who dislike the video.