next up previous
Next: Approach 1: Compare consecutive Up: CS101 Lecture 5 Previous: Specification of sorting

Algorithmic way of Sorting

One approach (not necessarily best) uses the following main idea.

Check for out-of-order pairs and swap them!

What is an out-of-order pair?

Variants of the ``bubble sort'' approach.

Let the biggest number sink to bottom (alternatively- let smallest number ``bubble'' to top).



G. Sivakumar 2000-08-13