views:

76

answers:

5

I'm a self-taught developer and, quite frankly, am not all that great at figuring out which search or sort algorithm to use in any particular situation. I was just wondering if there was a Design Patterns-esque listing of the common algorithms available out there in the ether for me to bookmark. Something like:

Name of algorithm (with aliases, if any)

Problem it addresses

Big-O cost

Algorithm itself

Examples

Other algorithms it may be used with/substituted for


I'm just looking for a simple, concise listing of the algorithms I probably should know in one location. Is there anything like this available?

+1  A: 

Wikipedia has a nice table that lists most of the common sorting algorithms along with classification of them and basic analysis of their complexity characteristics.

The more common sorting algorithms have pseudocode and more in-depth analysis. For less common sorting algorithms, you'll probably have better luck finding details in academic papers or real implementations.

James McNellis
+1  A: 

your should read CLRS.

In terms of problems variety, there are millions. and it all comes from puzzles and math.

Skienna has nice problems with different varieties.

+4  A: 

The web site http://www.sorting-algorithms.com/ shows many popular sorting algorithms, and describes their complexity and implementation. It goes the extra step to show, via animations, how those algorithms perform on different types of data (i.e pre-sorted, sparse, reverse-sorted, etc...).

Steve Guidi
ahh you beat me.
James
A: 

You have a great article on the wikipedia. http://en.wikipedia.org/wiki/Sorting_algorithm#Comparison_of_algorithms

But I would suggest reading some book. Almost every book has one chapter about sorting.

Klark
+1  A: 

This site has some examples of sorting algorithms, included visual aids to help you get the hang of it. I personally like the various best/worst/average/few unique cases they show.

James