Friday, March 6, 2009

What is Bubble Sort?

Bubble sort is a sorting algorithm that sorts data items. These data items are presumed to be arranged in a sequential order (i.e. like an array). Sorting takes place by stepping through all the data items one-by-one in pairs and comparing adjacent data items and swapping each pair that is out of order. Idea of swapping operation is to gradually moves either larger or smaller data items to the right or left. This swapping operation is repeated on the data items (i.e. array) until no swaps are required, indicating that the data items is in ascending or descending order.

click the link -> Bubble Sort for the pseudocode.

No comments:

Post a Comment

Post a Comment