MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What are the drawbacks of using mergesort?
A
It has no drawbacks.
B
It only works on arrays.
C
There are special cases where it runs very slowly.
D
It uses more memory.
Explanation: 

Detailed explanation-1: -13) What is the drawback of the mergesort with respect to storage? Answer: The mergesort requires an auxiliary array whose size equals the size of the original array. For languages, such as C++, which store the data items in the array, this requirement might not be acceptable in situations where storage is limited.

Detailed explanation-2: -Merge sort needs O(n) amount of memory in order to copy over elements as it sorts. This is probably the greatest drawback of the merge sort algorithm: it is an out-of-place sorting algorithm, that requires additional memory as its dataset grows.

Detailed explanation-3: -Merge sort is a stable and simple algorithm to implement, and as a result, can always run in O(nlogn) time. Merge sort is not an in-place algorithm. It requires 0(n) memory space for the array data structure, and uses additional resources to copy elements between arrays, meaning it runs much slower for larger datasets.

Detailed explanation-4: -Merge sort performs well when sorting large lists, but its operation time is slower than other sorting solutions when used on smaller lists. Another disadvantage of merge sort is that it will execute the operational steps even if the initial list is already sorted.

There is 1 question to complete.