Design and Analysis of Algorithms20825 marksSorting Algorithms
Find the best and worst case for Bubble sort.
Find the best and worst case for Bubble sort. [5]
Bubble sort is the simplest sorting algorithm that works by repeatedly swapping adjacent elements if they are in the wrong order. A list with n elements requires n-1 passes for sorting. In each pass, element a[i] is compared with a[i+1] and swapped if they are not in proper order. --- --- The bes...