- Oct 14, 1999
- 4,375
- 0
- 0
As some of you know (thanks to my thread about typos), I recently had to develop an algorithm in C++ to sort a vector. The only sorting algorithm I could remember from data structures was bubblesort, which is horribly inefficient. I know that quicksort is pretty good, but I couldn't remember how it works, so I sort of just made up my own. It seems to be pretty good, when sorting 64 elements, it makes 66 recursive calls (the worst-case and best-case are the same). For my purposes, that's good enough, but what are some better sorting algorithms that aren't too complicated? Any links to good online explanations of them would be cool too.