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 |
What is merge sort in daa?
Write a data structure for a queue.
1 Answers Tavant Technologies, Zensar,
How to compare Two Arrays?
What type of variable is age?
Define binary tree insertion.
How do you initialize an arraylist?
Does arraylist have a tostring?
What are AVL trees?
What is an example of an algorithm?
How do you sort large data?
What do you mean by the term “percolate up”?
What are the tasks performed while traversing a binary tree?