When is each sorting algorithm used? [closed]
First, a definition, since it’s pretty important: A stable sort is one that’s guaranteed not to reorder elements with identical keys. Recommendations: Quick sort: When you don’t need a stable sort and average case performance matters more than worst case performance. A quick sort is O(N log N) on average, O(N^2) in the worst case. … Read more