Which is better merge sort or quick sort?



Which is better merge sort or quick sort?..

Answer / Prasenjit Nayban

Whether Merge Sort or QuickSort is better depends on the specific use case and context. Merge Sort has a lower worst-case time complexity (O(n log n)) but slower for small arrays due to its divide-and-conquer approach. QuickSort has a lower average time complexity (O(n log n)), but it can suffer from a worst-case scenario of O(n^2) when the input array is already sorted or nearly sorted.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What is merge sort in daa?

1 Answers  


Write a data structure for a queue.

1 Answers   Tavant Technologies, Zensar,


How to compare Two Arrays?

1 Answers  


What type of variable is age?

1 Answers  


Define binary tree insertion.

1 Answers   Tech Mahindra,


How do you initialize an arraylist?

1 Answers  


Does arraylist have a tostring?

1 Answers  


What are AVL trees?

1 Answers   HAL,


What is an example of an algorithm?

1 Answers  


How do you sort large data?

1 Answers  


What do you mean by the term “percolate up”?

1 Answers  


What are the tasks performed while traversing a binary tree?

1 Answers  


Categories