开发者

Search/sort algorithms - is there a GoF-like listing for them?

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 prob开发者_运维问答ably should know in one location. Is there anything like this available?


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...).


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.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜