Ad Code

Write the algorithm of bubble sort in your words?

Write the algorithm of bubble sort in your words?


In this algorithm we compare consecutive numbers. If they are in required order e.g. if it is a descending sort
and the first is larger then the second, then we leave them as it is and if they are not in order, we swap them.
Then we do the same process for the next two numbers and so on till the last two are compared and possibly swapped.
Reactions

Post a Comment

0 Comments