• retagged by
607 views
5 5 votes


2 Answers

0 0 votes

both the oprtions B and C are correct

0 0 votes

A) Merge sort processes elements by diving and merging. It does not always perform more swaps than comparison. In fact, standard merge sort moves elements to another array rather than performing traditional element swaps. So A is False.

B) The total number of comparisons in the partition process depends entirely on how evenly the array is partitioned. In best case, array can be partitioned into two equal halves, creating balanced tree that require very few total comparisons (O(nlogn)).In worst case, the array may get split unevenly that forces the entire array to compared over and over again.(O($n^{2}$)). So B is False.

Note that if single partition routine is performed, then the number of comparisons remains same in best and worst case.

C) Merge sort uses an extra array to combine two subarrays. So it is not an inplace algorithm. Quicksort just picks a pivot and place it into its right position (no extra space). So C is True.

 

• edited by
Position:
Show:

Related questions

6 6 votes
2 2 answers
1.3k
1.3k views
GO Classes asked Oct 6, 2025
1,270 views
Suppose four characters A, B, C, D have the frequencies $15, 8, 6,$ and $5$, respectively. After constructing the optimal Huffman code for this alphabet, what is the tota...
5 5 votes
3 3 answers
1.2k
1.2k views
GO Classes asked Oct 6, 2025
1,207 views
A project manager has broken down a project into $8$ tasks: $A, B, C, D, E, F, G,$ and $H$. The dependencies between the tasks are shown in the directed graph below. A va...
5 5 votes
2 2 answers
814
814 views
GO Classes asked Oct 6, 2025
814 views
An algorithm performs a linear search for an element $k$ in an integer array of size $N$. The algorithm iterates through the array sequentially, starting from the first e...
11 11 votes
2 2 answers
860
860 views
GO Classes asked Oct 6, 2025
860 views
Let $S$ be a sorted array of $n$ distinct positive integers. Let $T(n)$ denote the time complexity of the most efficient algorithm to determine if there exist three indic...