1 1 vote What is the worst-case time complexity of the QuickSort algorithm when the pivot is always chosen as the middle element and the input array is already sorted in ascending order?$O(n)$ $O(\log n)$ $O\left(n^2\right)$ $O(n \log n)$ Programming in Python goclasses python-&-dsa goclasses-da-dpp goclasses-da-dpp-day-108 goclasses-python-&-dsa-practice-questions + – GO Classes 169 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
0 0 votes If the pivot is the middle element of a sorted array, it consistently partitions the array into two nearly equal halves, leading to the best-case recurrence. GO Classes answered Feb 25 GO Classes comment Share Follow 0 reply Please log in or register to add a comment.