Recent questions tagged goclasses-da-dpp-day-242

2 2 votes
1 1 answer
162
162 views
The standard $2$-way quicksort partition procedure uses the first element as the pivot and stops both scans when they encounter an element equal to the pivot.It is applie...
5 5 votes
1 1 answer
167
167 views
Suppose $n$ elements are divided into groups of $r$ elements. The median of each group is found, and the median of these group medians is used as the selection pivot.For ...
1 1 vote
1 1 answer
121
121 views
Which of the following are important design choices rather than arbitrary choices?In binary search, compute the middle index using $\texttt{(lo + hi) >> 1}$ instead of $\...
4 4 votes
1 1 answer
115
115 views
An array contains $n\geq 8$ distinct elements:$a_1<a_2<\cdots<a_n$The array is sorted using randomized quicksort.What is the probability that $a_7$ and $a_8$ are compared...
1 1 vote
1 1 answer
134
134 views
Two sorted subarrays, each containing $n/2$ elements, are merged into one sorted array of length $n$.What is the possible range for the number of key comparisons made dur...
To see more, click for the full list of questions or popular tags.