Computer Science, asked by amitesh01kuma, 1 year ago

Prove that the worst case of quicksort is the best case of bubble sort.

Answers

Answered by Sudin
2
Bubble sort has worst-case and average complexity both О(n²), where n is the number of items being sorted. There exist many sorting algorithms with substantially better worst-case or average complexity of O(n log n). Even other О(n²) sorting algorithms, such as insertion sort, tend to have better performance than bubble sort. Therefore bubble sort is not a practical sorting algorithm when n is large.

o) Worst case performance O(n²)
o) Best case performance O(n)
o) Average case performance O(n²)
o) Worst case space complexity O(n) total, O(1) auxiliary
o) Optimal No
Similar questions