Bubble Sort Algorithm | GeeksforGeeks

preview_player
Показать описание
Join us as we demystify the step-by-step process of Bubble Sort ALgorithm. Understand the algorithm's unique approach as it repeatedly traverses the list, comparing adjacent elements and swapping them if they are in the wrong order.

-------------------------------------------------------------------------

-------------------------------------------------------------------------

📖 Want to Learn more about Data Structures and Algorithms?

-------------------------------------------------------------------------

Follow us for more fun, knowledge, and resources:

Related Queries:
DSA course
Data Structures and Algorithms
DSA Bubble Sort
Bubble Sort algorithm
Sorting Algorithms
DSA sorting algorithms
working of bubble sort algorithm
time complexity of bubble sort algorithm
important algorithms for interview

#bubblesort #bubblesortalgorihtm #sortingalgorithm #sorting #algorithms #dsa #datastructuresandalgorithms #gfg #geeksforgeeks
Рекомендации по теме
Комментарии
Автор

Geek Of Geeks You Did That in 58 seconds what others couldn't do in 58 Minutes, Awesome Explanation...

AnimatedEducation
Автор

damn y u put that music and make us cry while learning...

cruzab
Автор

The most important thing in explaining this algorithm (and the only gotcha moment about it) is what the invariant is.
Basically, every single iteration of the outer loop, the next biggest item comes up to the right, sorted part of an array.
After K iterations of the outer loop, there'll be K sorted elements at the right side, therefore J < (length - 1 - K) check condition in the inner loop comes up.

mikkqu
Автор

this video explained in 57 secs what my teacher have explained in 50 mins.

Khinshadova
Автор

Wow this is the best video ever for this topic. Very quick and to the point. I knew what bubble sort was, and I've used it in the past, but couldn't quite remember how to properly code it. I was confused when I found out the proper implementation online, because it worked but I didn't know why j (the second for loop) was getting smaller every time. The visualization of the array sorting was very helpful. Thanks.

ResistantLaw
Автор

It's Simple, Precise & Clear...

AnimatedEducation
Автор

I taught bubble sort 40 years ago in basic. Your explanation is MUCH better.

kenmohler
Автор

I think in the code example is possible to initialize j to i + 1 to comparison between the same element. As an optimization is possible to add a flag to test if there was a swap after the loop and finish if there was none, because it means that the array is already sorted

raulcalvomartin
Автор

The worthnoting use of my life's one Its freaky marvelous.

jaygohil
Автор

All through my life I have been afraid of Searching and sorting but is it this simple ?

shaileshkumar
Автор

This is exactly what I wanted...loved it! <3

divyashekhar
Автор

Explanation duration is smaller than the Ads..though these are lucid enough to grasp the concept.

srikanthmargam
Автор

All these short sorting videos are amazing.

antonalm
Автор

This explanation is so amazing !! Thank you very much <3

huyennguyen
Автор

If no swap in the current pass, we can break the outer loop and say array is sorted. All the time we don't need go for N-1 passes

thangavelbhagavathiyappan
Автор

Thanku GeeksforGeeks for such tutorials!!! love to see this type of ....tutorials

AnkitJaiswal-ftgq
Автор

g4g usually good music too. This track is making me depressed..

jacksonkr_
Автор

Thank you GeeksforGeeks for such tutorials

betulalbayrak
Автор

that's quite nice and easily explained everything
thank you geeks for geek

shashiraj
Автор

Just. Wow. I came here from your official website just to thank you for amazing work! Short and sweet!

joefer