What are applications where quick sort use?

When I have gone through the different sorting algorithm available, I found that quick sort is best in average case.

But what are commercial application where it used?

all over the place. Databases might use it if you pull the data out with an order-by clause. Spreadsheets might use it if you sort the columns. Algorithms might use it if you need to check duplicate values (sort and compare adjacent values approach). People like to see data in an orderly presentation... and many algorithms require a pre-sort before they work or before they work efficiently.

Quicksort is nice but is it the best? It depends. With massive amounts of ram on modern machines, you can blow out a couple of gigabytes and do a very large bucket sort for integer data. I just did one to sort a very large list of 9 digit numbers. Shell sort is the best if your system (some embedded systems, for example) can't support recursion or have limited recursion stack memory. Some of the simpler sorts actually defeat quicksort on smaller amounts of data and are better for that. The bottom line is to not forget the other algorithms ... when doing real-time code, or trying to make a commercial program the best it can be, there are often reasons to pick one algorithm over another. Also, don't forget to split your data up and sort it on each cpu/core and put it back together with a mergesort if you start dealing with billions of items in your sort list, which does happen in commercial software.

Topic archived. No new replies allowed.