Bubble Sort in Plain English

preview_player
Показать описание
Learn to implement the Bubble Sort algorithm and ace your coding interview.

CONNECT WITH ME

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.
Рекомендации по теме
Комментарии
Автор

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.

utpalbarman
Автор

OMG I haven't heard of the Bubble Sort since college in '92!

zeloguy
Автор

Mosh u r the best among all . u r the only instructor. who teaches like that. thank u.

umarsiddique
Автор

Just completed your course from Udemy and I'm in love with the way of your teaching! So glad you have a YouTube channel!

ashishpuma
Автор

mosh is one among the best instructors

alestoraldous
Автор

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.

kavinbharathi
Автор

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 < arr.length; i++) {
if (arr[i - 1] > arr[i]) {
swap(arr, i - 1, i);
maxSwapIndex = i;
}
}
arrLength = maxSwapIndex;
}

}

silambarasan.ssethu
Автор

Mosh you are professional. You make a Quality base video in less earning 💰 . THANK YOU .

Aryan-lyho
Автор

I'm currently taking your react native course.. you're just the best

feranmiafrica
Автор

I had no clue you could declare variables inside your for loop. That's awesome.

Vassimau
Автор

The best programmer and instructor I’ve ever seen!

GfoxSim
Автор

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 😂

AaronAsherRandall
Автор

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"

keyasarker
Автор

Mosh gave me the motivation to try my own luck in being an instructor on my YouTube Channel.
I wish I will have his calmness and perfect explaining skills just as he does.
Lots of love Mosh <3

jimshapedcoding
Автор

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 🇮🇳🇮🇳

nishantrohilla
Автор

Mosh has got a million dollar Smile. Just by looking at him smile makes me very happy even in my toughest of times.

sujitprabhakaran
Автор

Hi mosh this is Arif Billah from bangladesh. Youre my true mentor thank you so much

arifbillahsheikh
Автор

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.

mahmudulislam
Автор

You are amazing, I have watched and completed all of your courses. I think you are the best programmer in the world

xxwolf_gamezxx
Автор

Wow... That's brilliant. Using array.length - i

raphaelnk