Computer Science, asked by anandamurugan36, 11 months ago

how to write bubble sort in python? ​

Answers

Answered by shreyakhandalkar
2

Answer:

simplest sorting algorithms. The two adjacent elements of a list are checked and swapped if they are in wrong order and this process is repeated until we get a sorted list. The steps of performing a bubble sort are:

Compare the first and the second element of the list and swap them if they are in wrong order.

Compare the second and the third element of the list and swap them if they are in wrong order.

Proceed till the last element of the list in a similar fashion.

Repeat all of the above steps until the list is sorted.

This will be more clear by the following visualizations.

Answered by Nilimapalb
3

Answer:

your answer is in the top

Attachments:
Similar questions