Python Tutorials – Bubble Sort Program

43
54



In this Python programming video tutorial we will learn about bubble sort program in detail.

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed which indicates that the list is sorted.

The algorithm which is a comparison sort is named for the way smaller or larger elements “bubble” to the top of the list. Although the algorithm is simple, it is too slow and impractical for most problems even when compared to insertion sort. Bubble sort can be practical if the input is in mostly sorted order with some out-of-order elements nearly in position.

Here we are writing the program using bubble sort algorithm.

Selection Sort Algorithm And Program:

Bubble Sort Algorithm:

#PythonProgramming #BubbleSort

For more free tutorials on computer programming

Nguồn:https://quydinh.com/

43 COMMENTS

  1. can we break the for loop after the iteration in which no swap happened. That might reduce the execution for long list. Please let me know if I am getting it wrong way.

  2. Amazing for people from non programming background trying to learning coding.
    You make sure the concept is understood.
    You have earned my subscription. Please keep doing this amazing work.
    Loads of Love from San Francisco!!

  3. I am telling you i have watched several videos on bubble sort none has explained better then you full marks. i am totally impressed. Surely i will recommend all my friends. Best Python tutorial on any channel

  4. If anyone asks me to suggest the best python tutorial youtube channel, I will suggest this channel only. Your Interpretation is in a good way.

LEAVE A REPLY

Please enter your comment!
Please enter your name here