1 1 vote 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 $\texttt{(lo + hi) / 2}$. When equal keys are encountered during merging, copy the element from the left subarray before the equal element from the right subarray. During $2$-way quicksort partitioning, stop both scans when they encounter keys equal to the pivot. In quicksort, always recursively process the left subarray before processing the right subarray. Algorithms goclasses goclasses-da-dpp goclasses-da-dpp-day-242 goclasses-cs-dpp goclasses-cs-dpp-day-340 algorithms python-&-dsa goclasses-python-&-dsa-practice-questions goclasses-algo-practice-questions multiple-selects + – GO Classes 137 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote ImportantUsing the unsigned right-shift calculation protects the middle-index computation when $\texttt{lo + hi}$ exceeds the maximum positive signed integer value.Therefore, this choice helps avoid an overflow-related error. ImportantWhen equal elements are taken from the left subarray first, their original relative order is preserved.This property makes mergesort stable.Therefore, B is important. ImportantSuppose an array contains many elements equal to the pivot.If both scans skip all equal keys, partitioning can repeatedly produce poor subproblems and lead to quadratic behaviour.Stopping on equal keys distributes equal elements across the partition more safely.Therefore, C is important. ArbitraryBoth recursive subarrays must eventually be sorted, but their processing order does not affect the final sorted result.Processing the right side first would also be correct.Therefore, D is not an important design requirement. GO Classes answered Aug 5 GO Classes comment Share Follow 0 reply Please log in or register to add a comment.