MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
what is a disadvantage of merge sort?
A
slow on long lists
B
not efficient
C
needs additional memory
D
slow for small lists
Explanation: 

Detailed explanation-1: -What Are the Drawbacks of the Merge Sort? For small datasets, merge sort is slower than other sorting algorithms. For the temporary array, mergesort requires an additional space of O(n). Even if the array is sorted, the merge sort goes through the entire process.

Detailed explanation-2: -Merge sort requires more space as it creates an extra array for storing, and no matter what it will compare every item.

Detailed explanation-3: -Merge Sort-Is a ‘Divide and Conquer’ algorithm that splits a list into discrete elements and then merges the elements back together in order. A merge sort is quicker and more efficient than a bubble sort when using longer lists. However, it uses more memory and can take longer to sort shorter lists.

Detailed explanation-4: -Quick sort is an in-place sorting algorithm. In-place sorting means no additional storage space is needed to perform sorting. Merge sort requires a temporary array to merge the sorted arrays and hence it is not in-place giving Quick sort the advantage of space.

There is 1 question to complete.