Python Tutorials - Bubble Sort Program
HTML-код
- Опубликовано: 14 дек 2024
- 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:
• Python Tutorials - Sel...
• Python Tutorials - Sel...
• Python Tutorials - Sel...
• Python Tutorials - Sel...
Bubble Sort Algorithm:
• Python Tutorials - Bub...
#PythonProgramming #BubbleSort
For more free tutorials on computer programming
/ amulsacademy
/ amulsacademy
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
Thank you :)
Amulya are you from Kerela ?
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!!
Thank you :)
when you teach,,, each and every time I fall in love with python... thank you .. for your dedication 🤗🤗
Thank you :)
@@AmulsAcademymam also make videos on dynamic programming, brute force ..... asap
When I watched other videos I was having difficulty understanding the optimization part. Finally I got it from your video. Thank You. Loved it.
Glad it helped! :)
I struggled with this part so much. You are the only one who explained it so perfectly.
Thank you :)
the most perfect explanation I've seen for bubble sort. thank u so much. i will definitely follow your channel from now on.
Thank you :)
Best programming channel out there , nothing can beat the tutors explanation.
What an explanation ability you have got, brilliant, amazing and outstanding. Totally excellent experience for those who are beginners in Python programming. I am your huge fan, no doubt I have subscribed you. Keep up the good work, Amulya. I really appreciate your work.
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.
Thank you:)
@@AmulsAcademy Bravo I hope you will do lessons about Data Structures. Thanks for the good job !!! 👏👏👏👏👏
Masha Allah!!! incredible depth of knowledge ...stunning ability to teach ...10 out of 10
Thank you :)
seriously the quality of knowledge i get is far better any other video
Thank you :)
Flawless explanation mam thanks a ton for your crystal clear explanation
Amulya's Academy is so good at teaching. It explains everything easily that anybody can understand. Also, the way of teaching also amazes me. I am happily going through my "Data Structure" course from "Amulya's Academy" and this helps me a lot in my studies as a CSE student. Moreover, I have recommended my friends sharping their knowledge from this channel. Thank you so much and Love from Bangladesh!
Ur amazing and ur teaching was excellent keep going and make more videos ......☆☆☆☆☆
thanks a lot you just helped me out. I've been searching for the most basic one as I don't really have any background knowledge of coding. Finally, i found my savior. Thanks a lot. I'll be willing for the rest related to python too.
Thank you so much mam... tomorrow is my practical exam and I luckily found this one...😊😊😊
Best explanation so far on bubble sort. God bless you. Thanks
I have seen many tutorial but not understood.
This vedio really amazing to understand.
Thank you :)
I have no idea why people have disliked the video. I don't have to repeat the video or search for another source to understand
Well done, best explanation for the vague . it's easier than the others when you explain something, GO ON.
Thank u
Thank you :)
A fantastic, well articulated video explaining bubble sort. The python solutions and the variations of what the code can do is very informative.
Many thanks
Glad you liked it! :)
your explanation is smooth and steady
Thank you :)
Wow , you have explain it in simple way and in-depth . Thank you sooo much .
आपके जैसी वीडियोस एक्सप्लेनेशन किसी के नहीं देखे कुछ और सिंपल सी ,सी प्लस प्लस में जैसे प्रोग्राम करवाते थे वैसे पाइथन के बनाये क्योंकि राजस्थान बोर्ड में पहली बार पाइथन प्रोग्रामिंग लैंग्वेज लगी है 11th एंड 12th में
No words😳.....Thanks a lottttt buddy and plzz keep on uploading so that it can help USS😅 to understand programing
Thank you, I will :)
Jo Jo lockdown main madam ki videos dekh raha hein like karooo ... Your's teaching makes python into an another Animal ... Plz keep it up madam.. 😍😍😍😍
There is no word to explain. Suuuuuperb mam
Thanks a lot :)
underrated yt channel
Thank you :)
your teaching way very efficient. Thank you for this video. You give your best while teaching any topic.
Amazing explanation and pls make more videos on different algorithms in python like greedy algo, BFS, DFS etc
best teacher in the universe thank you
Thank you :)
You are a great teacher madam ,we need more of your videos!!!!
Your explanation is very clear.....I like your video
Thank you :)
Mam really explained very well..I enjoyed writing program's
Thanks a lot :)
Best explanation ever.
Thank you :)
Your all videos are very much helpful and you make it look simple 😊😊😊
Mam ur explanation was so nice it is easy to understand keep rocking like this mam
Thanks a lot :)
Nice explaination and awesome voice 😍😍
Thanks for making videos on python
It's my pleasure :)
What is the difference between Selection Sort and Bubble Sort ? In both sorting techniques we can do both ascending and descending.
Each and every sorting technique allow us to sort list of numbers in ascending as well as descending order, but each technique has its own way of sorting or working.
we can say algorithm of each technique is different.
Amazing ...... Wow fantastic ....Thanks & Love u ....
Most welcome 😊
best and amazing explanation
Thanks a lot :)
Awesome ma'am btw are u from south India?
Really good explanation
Thank you :)
Mam, program is working extremely fine but any other reason for not using else in loop - only if condition we mentioned.
else part is not needed here :)
@@AmulsAcademy Thanks mam
Very great explanation.
For user input we can use the split method:
array=list(map(int,input().split())).
Really awesome great video.
Thanks for the visit :)
Hii sista...Will there be any different swapping Method??I mean by doing same code in while loop
Yes you can use third variable to swap 😊
a=10
b=5
temp=a
a=b
b= temp
Amulayaji, you explanation is very simple and full informative related to that particular topic 👌🙂...Could you please provide me your complete series of Python learning from beginning to end 🙏
Please tell me, how to show the status after any iteration like after 3rd iteration, 2nd iteration
w=1
list1 = [10,15,4,23,0]
for j in range(len(list1)-1):
print("iteration",w)
w=w+1
for i in range(len(list1)-1):
if list1[i]>list1[i+1] :
list1[i], list1[i+1] = list1[i+1], list1[i]
print(list1)
else:
print(list1)
print()
#w=w+1
print ("Sorted list is:")
print(list1)
:)
I love your explanation mam. You are more than awesome
Thanks a lot 😊
Great work, keep going !!!
such a great explaination
How to think logic any program?
You're doing great. Mam' ,V well explained.
Thank you :)
i want to sort a array string like {"Man","cda","zyx"} to {"amn","abc","xyz"} please help me i want it algoritium
you can use sorted() :)
easily understandable thank you so much
Pleasure 😊
could you please tell me deference to use for loop range function or without range function ? for I in range(Len(are)) why we use range and Len function without it we also get index
pls mention complexities and minimum number of swaps are required
ValueError: invalid literal for int() with base 10: '4,3,2'
how to solve this error?
plz suggest me
thank you so much mam
Most welcome 😊
I tried the exact same staments but the output doesn't come please help me!!!!
Give me the program i will check :)
Your 2nd for loop is running n-1 times ... so if I put an input in descending order it will give wrong output.... and if I run that loop n times, it works.
Please tell me if I am anywhere wrong.
I need a program to sort alpha numeric list in python programming
Will try :)
@@AmulsAcademy tq
Very nice. Thank you.
My Pleasure :)
ValueError: invalid literal for int() with base 10: '4 3 2 1'
this error occurs when using this program
plz...suggest me how solve this error
Osm explanation ❤❤❤
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.
You can try that :)
Wow what a explanation
Thank you :)
please upload quick sort algorithm as it is being asked in so many interviews...
I will do that asap:)
thanks.
Can you give or explain bubble sort program Using while loop using a function amulya ..??
def bubbleSort(l):
i = 0
while i
@@AmulsAcademy thanq amulya ..Tq
Awesome maam ! maam when will we get BFS algorithm in DS series ? 😍
This is freaking great. Thank you very very very much!
It's really good, can you make all algorithm and data structure videos it's very helpful for everyone, Thank you very much
Very good explaination..plz make a tutorial on matrix chain multiplication
Thank you :)
Sure :)
Ma'am really a good videos thank you
Welcome :)
thank you for good explanation
My Pleasure :)
Very Cool!!👍👍
Thank you 😊
Thank you Amulya ❤️ Love you help me to crack interview
Bohat sahi hai bhai
Please make videos on algorithms in python
I will try :)
Well Explained.
What all changes are needed if we are writing this as a function. For reducing the iteration steps and to show all the swapping steps.
def bubble_sort(n):
for i in range(len(n)-1):
if n[i]>n[i+1]:
n[i],n[i+1]=n[i+1],n[i]
bubble_sort(n)
n=[100,120,900,400,800,10000000,12,1,6,300,21,10000]
bubble_sort(n)
print(n)
You killed it.
Well explained
In bubble sorting compare starts from starting and this sorting is of insertion sorting
Step 1 − If it is the first element, it is already sorted. return 1;
Step 2 − Pick next element
Step 3 − Compare with all elements in the sorted sub-list
Step 4 − Shift all the elements in the sorted sub-list that is greater than the
value to be sorted
Step 5 − Insert the value
Step 6 − Repeat until list is sorted
Insertion sort algorithm
:)
Plss..upload a video on insertion and merge sort
Sure i will do soon :)
very help full
Thank you :)
Excellent
Thank you:)
Upload the code in comment or description
Ma'am, How to create game in python?
You can use PyGame :)
Do you know CodeWithHarry?
RUclipsr right ?
Yes he also teaches coding
Yeah, I know 😊
In python programming
List=[130,180,120,80,60]
Output:
Height order of students before sorting:
130 180 120 80 60
Height order of students after iteration 1
130 120 80 60 180
Height order of students after iteration 2
120 80 60 130 180
Height order of students after iteration 3
80 60 120 130 180
Height order of students after iteration 4
60 80 120 130 180
Final sorting of students in a bench are:
60 80 120 130 180
Please reply and solve this problem mam
Thanks a lot ma'am....
Please do the video regarding chapter wise of cbse
You are just awesome, How old are you ?
Best video
Thank you :)
you are wonderful!!
Can't understand that 5 input step
thank you
Pleasure :)
Thanks a lot