Mergesort uses extra space but quicksort requires little space. Quick sort is 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. it is not in-place giving Quick sort the advantage of space.
Worst Cases :
The worst case of quicksort O(n2) .It can be easily avoided with high probability by choosing the right pivot. obtaining the data in quick sort,its improvise the performance and becoming as efficient as Merge sort.
Locality of reference :
Quicksort having particular exhibits good cache locality and its make it faster than merge sort in any cases like in virtual memory environment. Merge sort is better for large data structures, Mergesort is a stable sort, while quicksort and heapsort.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Auxiliary Space :
Mergesort uses extra space but quicksort requires little space. Quick sort is 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. it is not in-place giving Quick sort the advantage of space.
Worst Cases :
The worst case of quicksort O(n2) .It can be easily avoided with high probability by choosing the right pivot. obtaining the data in quick sort,its improvise the performance and becoming as efficient as Merge sort.
Locality of reference :
Quicksort having particular exhibits good cache locality and its make it faster than merge sort in any cases like in virtual memory environment. Merge sort is better for large data structures, Mergesort is a stable sort, while quicksort and heapsort.