Computer Science, asked by kanu06, 5 months ago

time complexity of bubble sort in C language ​

Answers

Answered by ay5630289
1

Answer:

It is the slowest algorithm and it runs with a time complexity of O(n^2). Bubble sort can be optimized by using a flag variable that exits the loop once swapping is done. The best complexity of a bubble sort can be O(n). O(n) is only possible if the array is sorted.

Answered by divyakondeapati
1

Answer:

answer is

Explanation:

It is the slowest algorithm and it runs with a time complexity of O(n^2).Bubble sort can be optimised can using a flag variable that exists the loop once swaping is done .The best complexityof a bubble sort can be O(n).O(n) is only possible if the array is sorted .

HOPE it's helpful to you

PLSS MARK ME AS BRAINLIST AND THANK ME PLSS

Similar questions