The key word in this question is "expected", not "worst case" or "best case". That single word tells us we need to average over every possible way the pivot could split the array, rather than picking one fixed scenario.
Here is the setup: quicksort always grabs the first element of the current subarray as pivot. If the array were sorted or reverse sorted, that would always give the smallest or largest element, a very lopsided split of size $1$ and $n-1$. But this array is randomly ordered, so nothing forces the first element to be extreme, it is just as likely to be any rank in the array.
Formally, after we partition around the pivot, say $k$ elements land in the left part and $n-1-k$ land in the right part. Because the ordering is random, $k$ can be $0, 1, 2, \dots, n-1$ with equal probability $\frac{1}{n}$ each, there's no reason for any particular split to be favored over another.
Now build the expected cost. For a fixed $k$, the total work is $T(k)$ to sort the left part, $T(n-k-1)$ to sort the right part, plus the linear partition cost. Since we do not know $k$ in advance and every value is equally likely, we take the average across all $n$ possibilities:
\[ T(n) = \frac{1}{n}\sum_{k=0}^{n-1}\Big(T(k) + T(n-k-1)\Big) + O(n) \]Let's summarize why the other three do not fit:
Averaging over all $n$ equally likely split points is what genuinely captures "expected time" here, and that is exactly the recurrence in option (D).
\[ \boxed{T(n) = \frac{1}{n}\sum_{k=0}^{n-1}\left[T(k)+T(n-k-1)\right] + O(n)} \]\(\underline{\hspace{1cm}}\) refers to a set of data values and associated operations that are specified accurately, independent of any particular implementation.
Match LIST-I with LIST-II
\[\begin{array}{|c|c|}\hline \text{LIST-I} & \text{LIST-II} \\ \hline \text{A. The first index comes after the last index.} & \text{I. Head-tail Linked List} \\ \hline \text{B. More than one queue in the same array of sufficient size} & \text{IV. Multiple Queue} \\ \hline \text{C. Elements can be inserted or deleted at either end.} & \text{III. Circular Queue} \\ \hline \text{D. Each element is assigned a priority.} & \text{II. Priority Queue} \\ \hline \end{array}\] Choose the correct answer from the options given below:
Consider the following statements about arrays. Which of the following are TRUE?
A. The index specifies an offset from the beginning of the array to the element being referenced.
B. Declaring an array means specifying three parameters; data type, name, and its size.
C. The length of an array is given by the number of elements stored in it.
D. The name of an array is a symbolic reference to the address of the first byte of the array.
Choose the correct answer from the options given below:
Consider the binary tree given below. What will be the corresponding infix expression to this?
