errors in Alg in "C" by Sedgewick

Doug Gwyn gwyn at smoke.brl.mil
Tue Jan 22 13:48:34 AEST 1991


In article <DAVIDD.91Jan19220640 at wolf.cs.washington.edu>, davidd at wolf.cs.washington.edu (David Doll) writes:
> Hello, I just got a copy of Algorithms in C by R. Sedgewick. I'm working with
> graph stuff and I typed in the alg on page 421 and my compiler (Ultrix 4.1 on
> a DS5000) puked on almost everything I typed in...I doubled checked my typing
> so I'm guessing that he's wrong - has anybody else had problems with this
> book? Is there any place else that would have correct(?) code? Thanks.

Well, there are some problems with typing in JUST the supplied code,
as it does not include declarations for malloc() or scanf().  Also,
on p. 420 Sedgewick notes that v1, v2, and index() are omitted since
they depend on the graph representation.  Thus, you should use the
given code as a guide to writing your own, not just copy it blindly.



More information about the Comp.lang.c mailing list