Sorting

Sorting – Bubble sort

Bubble sort: Two consecutive elements are compared.  It sorts the elements in right to left fashion.  Thus, (n-i) comparisons are made. Example: Frequency: i                       j                       number of times ——————————————————————————————— 1                                             1 to n-i                          n-1 2                                             1 to n-i                          n-2 3                                             1 to n-i                          n-3 –                 …

Sorting – Bubble sort Read More »

You cannot copy content of this page.