Prove that the worst case of quicksort is the best case of bubble sort.
Answers
Answered by
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
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
Computer Science,
8 months ago
Biology,
8 months ago
Physics,
1 year ago
Chemistry,
1 year ago
English,
1 year ago