Dec 24, 2008

Difference between merge and quick, when to use which?

Difference between merge and quick, when to use which?

Merge sort is stable, always O(nlog(n)), but need external storage O(n)
Quick sort is in place sorting with O(nlogn), but the worst case performance for quick sort is O(n^2)
Merge sort and heap sort is stable, others are not stable

No comments:

Post a Comment