Junior
What is the time complexity of sorting algorithms QuickSort, BubbleSort, and HeapSort in Big O notation?
sobes.tech AI
Answer from AI
- QuickSort:
- Average case: O(n log n)
- Worst case: O(n^2)
- BubbleSort:
- Average case: O(n^2)
- Worst case: O(n^2)
- HeapSort:
- Average case: O(n log n)
- Worst case: O(n log n)