# Algorithms reference?

**URL:** <https://boards.straightdope.com/t/algorithms-reference/5272>\
**Category:** Factual Questions\
**Created:** [December 10, 1999, 8:09am UTC](https://boards.straightdope.com/t/algorithms-reference/5272 "1999-12-10T08:09:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![AuraSeer](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@AuraSeer](https://boards.straightdope.com/u/AuraSeer)\
**Post date:** [December 10, 1999, 8:09am UTC](https://boards.straightdope.com/t/algorithms-reference/5272/1 "1999-12-10T08:09:00Z")

</div>

Can any of you direct me to a good reference for advanced programming and algorithms? I’m working on a rather complex project, and if useful algorithms have already been designed, I’d rather use them than reinvent the wheel.

An online resource would be preferable, but I’d also like to pick up a few good books.

* * *

Laugh hard; it’s a long way to the bank.

---

<div class="post-metadata">

**Author:** ![NanoByte](https://avatars.discourse-cdn.com/v4/letter/n/ecc23a/32.png) [@NanoByte](https://boards.straightdope.com/u/NanoByte)\
**Post date:** [December 10, 1999, 8:35am UTC](https://boards.straightdope.com/t/algorithms-reference/5272/2 "1999-12-10T08:35:00Z")

</div>

Maybe you ought to be just a _ **bit** _ more specific, without divulging the secrets of your project.

Ray

---

<div class="post-metadata">

**Author:** ![Spiritus\_Mundi](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@Spiritus\_Mundi](https://boards.straightdope.com/u/Spiritus_Mundi)\
**Post date:** [December 10, 1999, 8:38am UTC](https://boards.straightdope.com/t/algorithms-reference/5272/3 "1999-12-10T08:38:00Z")

</div>

It would be easier to recommend a reference if you could narrow down the type of problems you are trying to solve.

As a jumping of point, I have always found Numerical Recipes in C to be useful over a broad range of applications. But it may be a little out of date these days. (I don’t drop code anymore, and I am not certain when the last update was published.) Still, it is worth looking at if you are doing any significant number crunching. There are also variations for other languages if you are not familiar with C.

* * *

- 

The best lack all conviction  
The worst are full of passionate intensity.  
\*

---

<div class="post-metadata">

**Author:** ![Glitch](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@Glitch](https://boards.straightdope.com/u/Glitch)\
**Post date:** [December 10, 1999, 1:31pm UTC](https://boards.straightdope.com/t/algorithms-reference/5272/4 "1999-12-10T13:31:00Z")

</div>

“The Algorithm Design Manual” by Steven S. Skiena is quite good for just generic algorithms.

There are lots of good books dealing with specific branches of computer algorithms.

* * *

“Glitch … Anything.” - Bob the Guardian

---

<div class="post-metadata">

**Author:** ![Hunsecker](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@Hunsecker](https://boards.straightdope.com/u/Hunsecker)\
**Post date:** [December 10, 1999, 4:35pm UTC](https://boards.straightdope.com/t/algorithms-reference/5272/5 "1999-12-10T16:35:00Z")

</div>

If you want some theory mixed with your algs, go with  
_Introduction to Algorithms_  
by Corman, et.al.  
ISBN: 0262031418  
(I’ve always heard this one referred to as the “CLR” book, from the authors’ last names)

Its a massive book that has some very slick basic data structure manipulation algs.

Also, Sedgewicks _Algorithms In C++_ (ISBN: 0201350882) is pretty good.

And for the truly hard-core, Kunth’s the Art of Computer Programming can’t be beat.

---

<div class="post-metadata">

**Author:** ![Arnold\_Winkelried](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@Arnold\_Winkelried](https://boards.straightdope.com/u/Arnold_Winkelried)\
**Post date:** [December 11, 1999, 6:17am UTC](https://boards.straightdope.com/t/algorithms-reference/5272/6 "1999-12-11T06:17:00Z")

</div>

That would be “The Art of Computer Programming” series by Donald K **nu** th. Not to be nitpicky, but spelling the author’s name wrong would make it difficult to find in a search engine.

The Art of Computer Programming : Volume I, Fundamental Algorithms, Third Edition; Knuth, Donald E.  
Addison Wesley Longman; 06/1997; 650 pages

The Art of Computer Programming : Volume 2, Seminumerical Algorithms, Third Edition; Knuth, Donald E.  
Addison Wesley; 10/1997; 762 pages

The Art of Computer Programming : Sorting and Searching, Volume 3, Second Edition; Knuth, Donald E .  
Addison Wesley; 05/1998; 780 pages

* * *

Quand les talons claquent, l’esprit se vide.  
Maréchal Lyautey

---

<div class="post-metadata">

**Author:** ![Jebediah](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jebediah](https://boards.straightdope.com/u/Jebediah)\
**Post date:** [December 11, 1999, 6:30am UTC](https://boards.straightdope.com/t/algorithms-reference/5272/7 "1999-12-11T06:30:00Z")

</div>

Just to build consensus, I will echo that Knuth’s 3 volumes are the Torah of computer algorithms and is worth bonus geek points whenever used as a reference, and that Sedgewick is what actually appears on most programmers bookshelves.

---

<div class="post-metadata">

**Author:** ![Hunsecker](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@Hunsecker](https://boards.straightdope.com/u/Hunsecker)\
**Post date:** [December 10, 1999, 7:43pm UTC](https://boards.straightdope.com/t/algorithms-reference/5272/8 "1999-12-10T19:43:00Z")

</div>

Arnold: Thanks for the correction. I really should double check before I post.

Jebediah: Thats been my experience too. I’ve only known two people with a copy of any of Knuth’s books, and only one of them has actually read them.

I still like the CLR book better than Sedgwick, because of the theory and proofs and all that jazz. But I’ll agree that for a production environment you could give a damn about proving the worst case runtime for an alg. and just want something you can plug into your code. Sedgwicks book is great for that.

---

<div class="post-metadata">

**Author:** ![AuraSeer](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@AuraSeer](https://boards.straightdope.com/u/AuraSeer)\
**Post date:** [December 11, 1999, 6:38am UTC](https://boards.straightdope.com/t/algorithms-reference/5272/9 "1999-12-11T06:38:00Z")

</div>

A few words apparently got lost from my first post. In particular, that should have read “…advanced **geometric** programming and algorithms”.

I know that Knuth’s books are considered the canonical reference, but they cost a bit more than I’m willing to spend right now. That’s one big reason I’d like to find a web reference; it’s fre

---

<div class="post-metadata">

**Author:** ![Hunsecker](https://avatars.discourse-cdn.com/v4/letter/h/d78d45/32.png) [@Hunsecker](https://boards.straightdope.com/u/Hunsecker)\
**Post date:** [December 11, 1999, 5:42pm UTC](https://boards.straightdope.com/t/algorithms-reference/5272/10 "1999-12-11T17:42:00Z")

</div>

Aah, geometric algorithms…

OK, try the comp.graphics.algorithms FAQ ( [http://www.faqs.org/faqs/graphics/algorithms-faq/](http://www.faqs.org/faqs/graphics/algorithms-faq/) ), that has links to all kinds of alg. pages. It also has a list of computational geometry books.  
[http://www.magic-software.com](http://www.magic-software.com) is a good resource for algs you can copy and paste into your code.

The geometry center at Univ. Minnesota is another place to check out: [http://www.geom.umn.edu/](http://www.geom.umn.edu/)  
and [http://www.geom.umn.edu/software/cglist/](http://www.geom.umn.edu/software/cglist/)

Hope that helps.  
(BTW: Sedgewick has a few chapters on some simple geometry algorithms. Convex hulls, quad-trees and the like, IIRC)

---

<div class="post-metadata">

**Author:** ![Lumpy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lumpy/32/446_2.png) [@Lumpy](https://boards.straightdope.com/u/Lumpy)\
**Post date:** [December 11, 1999, 7:33pm UTC](https://boards.straightdope.com/t/algorithms-reference/5272/11 "1999-12-11T19:33:00Z")

</div>

Probably not what the OP was looking for, but I did (re)invent an algorithm for determining whether bit(x) in the binary value of a decimal number is zero or one. I was rather pleased with myself.
