Computer Science, asked by theintelligent99, 6 days ago

what is bubble sorting method in python?​

Answers

Answered by dt105349
0

Answer:

A bubble sort compares pairs of adjacent elements and swaps those elements if they are not in order. It is commonly implemented in Python to sort lists of unsorted numbers. Bubble sorts are a standard computer science algorithm.

By using a bubble sort, you can sort data in either ascending or descending order. Starting from the first element in a list, a bubble sort will compare the first and second elements. If the first element is greater than the second, a swap occurs.

This process is repeated until every item in a list is checked. Then, a bubble sort will loop through the list again. This occurs until no more swaps need to be performed.

Answered by mddanish0929
0

Explanation:

Bubble sort is a sorting algorithm that compares two adjacent elements and swaps them until they are not in the intended order. Just like the movement of air bubbles in the water that rise up to the surface, each element of the array move to the end in each iteration. Therefore, it is called a bubble sort.

Similar questions