Question

A software development team is implementing a sorting function for a large dataset in their project. They decide to use the quick sort algorithm to optimize performance. However, they observe that the function occasionally takes much longer to execute, especially when the dataset is sorted in ascending or descending order before being processed. Based on this scenario, what is the time complexity of the quick sort algorithm in its worst case? 

A O(n)
B O(n log n)
C O(log n)
D O(n²)
E O(n³)
Practice Next

Relevant for Exams:

Hey! Ask a query