Sorting Follow-up

Results 1 to 2 of 2

Thread: Sorting Follow-up

  1. #1
    Join Date
    Dec 1969

    Default Sorting Follow-up

    I asked a question yesterday asking for an example of a pivot sort, since i believe that is the fastest method of sorting. That's my question. What is the fastest method of sorting, and could you provide a description or example or link to an example of what it is, in the case that i don't know how the sort works?

  2. #2
    Join Date
    Dec 1969

    Default There is no absolute answer...

    If the data happens to be already sorted, for example, a well-written bubble sort (usually considered the dregs of sorting algorithms) will be the fastest.<BR><BR>Then, too, the language you are using can have some influence on things. And what happens if the data you want to sort won&#039;t all fit in memory (a common occurrence in databases)? And...<BR><BR>Well...<BR><BR>The answer, in other words, is the same as the answer for *most* programming questions: "It depends ...."<BR><BR>Having said all that: Yes, it is generally agreed that the "QuickSort" is a reasonable compromise for many situations. It&#039;s not the simplest to implement, but it&#039;s not *that* hard. Its worst case performance is very, very good. Its best case performance is so, so. On works.<BR><BR>But two of the most important questions that are seldom asked are: How much data do you have to sort? How is it organized?<BR><BR>Until you answer *those*, it&#039;s really impossible to give a truly definitive answer.<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts