Mastering Algorithms with Perl by Jon Orwant, Jarkko Hietaniemi & John Macdonald Here are the changes made in the 1/00 reprint: (xvi) In the first paragraph, Andi Karrer was added to the alphabetical list of reviewers. {12} Changed forloop(0, 1) to bruteforce(0, 1) Changed 0.6180334 to 0.618034 (14) Third line: inserted "sometimes" between "can" and "manipulate". In the second-to-last line of the second-to-last paragraph, changed "binary floating-point representations" to "IEEE floating-point representations." (30) Changed "For lists of lists and lists of hashes," to "For the list of lists and the hash of lists below, " {34,35,36} Inserted a . immediately before the \n in the print() statements. (36) In the footnote, changed "Srinam" to "Sriram". (38) In the eighth line from the bottom, changed "thousand bytes" to "kilobytes" (50) Figure 3-3: Changed $nine->[0] and $sixteen->[0] to $nine->[NEXT] and $sixteen->[NEXT]. {53} In the last block of code, changed: $tail = \${$node->[NEXT]}; to: $tail = \$node->[NEXT]; {55} Changed: $tail = \${$line->[NEXT]}; to: $tail = \$line->[NEXT]; {57} Changed: for ($pred=\$list; $elem = $$pred; $pred = \${$elem->[NEXT]}) { to: for ($pred=\$list; $elem = $$pred; $pred = \$elem->[NEXT]) { (60) In the third-to-last paragraph, changed "A deque implemented as a list" and "the list is long" to "A deque implemented as an array" and "the array is long". (64) Figure 3-7: changed the first "(count 2)" to a "(count 1)". (66,67,68) As the program is explained, the text snippets explaining the code follow the code; they should precede the code instead. Top of page 66: removed the colon and replacee it with a period, and flowed in the next full prose paragraph (beginning with "The new method...". Where that prose paragraph was, moved the next paragraph, the one beginning with "The destroy method...". Repeated this for the next two paragraphs, moving "The next and prev methods..." up, and then "The append and prepend methods..." and finally "The remove method...". Changed index references where necessary. {68, 70} Changed double::->new to double->new (3 occurrences) (71) Under "Infinite Lists", changed "The Perl Journal, Issue #6" to "The Perl Journal, Issue #7". (74) First full paragraph: changed "(about 5,000 names)" to "(about 50,000 names)". In the eighth to last line: changed "book for 100,000 people" to "book for 50,000 people" {77} In the first line of the second comment for basic_tree_del(), changed # tree_link has to be made to # $tree_link has to be made {87} In set_height(), changed both instances of $lh = $p->{height} to just $p->{height}. (88) Top of page: changed "the two granchildren under node L" to "the two grandchildren under node R". (96) Changed "It compares the starting element with the larger of its children (or with its only child if there is only one) and moves that child up into its position if it is large enough." to "It compares the starting element with the smaller of its children (or with its only child if there is only one) and moves that child up into its position if the child is smaller." {96} In heapify_array_up(), changed $#$array to @$array {99} In revsortheap(), replaced the two lines my $i = $#$array and for ( $i = @$array; $i; ) { with the single line for (my $i = $#$array; $i; ) {. (99) Changed the subhead from "The Heaps Module" to "The Heap Modules". (118) Sixth line from bottom: changed %torn_books = sort %hash; to %torn_books = sort %books;. (119) Footnote: The "é" should be "è". (121) Everything is correct, but since the code works on strings, changed @array = (8, 4, 7, 1, 0, 3, 6, 2, 5, 9); to @array = qw(able was i ere i saw elba); and changed the following 0 1 2 3 4 5 6 7 8 9 to able elba ere i i saw was {129} At the code snippet at the bottom of the page, inserted a comment after second line saying: # $small is the minimum element. {134} In the first line of code on this page, inserted a left parenthesis before the first $_[0] and a right parenthesis before the ;. {136} Inserted this line immediately above sub heapify;: use integer;. {139} Halfway down the page: in the quicksort_recurse() subroutine, changed the line: my ( $last_of_first, $first_of_last, ) = to: my ( $first_of_last, $last_of_first ) = (140) Seventh line from top: changed "and then use the last one" to "and then use the middle one". {147} In the counting_sort() subroutine, removed the -1 from the end of the second line. Changed $max to ($max+1) in the third line. In fifth line, changed $count[ $_] } 0..$max-1; to $counter[ $_ ] } 0..$max;. (160) End of second paragraph: changed "slower sorting function" to "slower searching function" {163} Changed my ($low, $high) = (0, @$array) to my ($low, $high) = (0,scalar(@$array)) {163} Changed the three lines beginning $array->[$cur] lt $target to if ($array->[$cur] lt $target) { $low = $cur + 1; # too small, try higher } else { $high = $cur; # not too small, try lower {165} Changed the long string of Courier hyphens to a horizontal line. {214} At the bottom of the page, changed the line that reads next TRYELEM unless $_->{ $possible }; to next TRYELEM unless exists $_->{ $possible };. {215} There were two one-line snippets in the middle of this page; removed keys from both. {220} In the difference() subroutine, there were two occurrences of shift. Changed each to shift(). (228) At the bottom of the page, changed both simpsons to dinos. (241) In footnote, changed: Just as this book was going into press, Michael Wallace released the AI::Fuzzy module for fuzzy sets. to: Just as this book was going into press, Michal Wallace released the AI::Fuzzy module for fuzzy sets.