 Search  ### Topic:Editor's Picks      # Essential Algorithms: A Practical Approach to Computer Algorithms

Rod Stephens
ISBN: 978-1-118-61210-1
Paperback
624 pages
August 2013
This title is out-of-print and not currently available for purchase from this site.   Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
12 Error in Text
The end of the first paragraph after the "Logarythms" box currently reads:
It's a sorted tree because every node's value lies between the values of its left and right child nodes.

It is true that a sorted tree has this property but more precisely the text should say:
It's a sorted tree because every node's value is at least as large as its left child and no larger than its right child.
09/20/2013
14 Error in Text
A full complete binary tree of height H has 2H nodes.

This text was trying to be approximate so it should have said:
The tree has approximately 2H nodes.

More precisely a full complete binary tree of height H has 2H+1 - 1 nodes. (This fact is mentioned in the second bullet point on page 232.) Given this change, the sentence that follows on page 14 should also be corrected. Again if you're looking at Big O notation, a full complete binary tree containing N nodes has height roughly log2(N). More precisely the height is log2(N + 1) - 1. (See the third bullet point on page 232.)
09/20/2013
32 Errata in Text
inside the box "A Fairly Random Array", the calculation printed in large test before the penultimate paragraph ends with (N-1)/(N-(k-1)), it should be 1/(N-(k-1)) as the probability of Pk defined in the general case a few lines above as Pi = 1/(N-i-1). As it stands, the claimed simplification to 1/N is not mathematically correct when based on the printed calculation, when it should be, the printed calculation simply being wrong.
This is correct. It was that way in the original text and got changed somewhere along the way to print. I suggest the follow erratum:
in the box "A Fairly Random Array." The last term in large equation should be 1/(N-(k-1)).
11-Oct-16
2 36 Error in Text
The fourth paragraph on the page begins:
More generally, for the exponent P, the algorithm calculates log(P) powers of A. It then examines the binary digits of A to see which of those powers it must multiply together to get the final result.

More generally, for the exponent P, the algorithm calculates log(P) powers of A. It then examines the binary digits of P to see which of those powers it must multiply together to get the final result.
09/05/2013
39 Error in Code
The FindPrimes algorithm uses this code:
While (next_prime < stop_at)

This should be:
While (next_prime <= stop_at)
09/20/2013
40 Error in Text
The fourth paragraph in the section "Testing for Primality" currently reads:
Fermat's "little theorem" states that if p is prime and 1 ≤ n ≤ p, np-1 Mod p = 1.

This should say:
Fermat's "little theorem" states that if p is prime and 1 ≤ n < p, np-1 Mod p = 1.
09/20/2013
53 Error in Text
In an infinite set of composite numbers called Carmichael numbers, every relatively prime smaller number is a Fermat liar. In other words, p is a Carmichael number if every n where 1 ≤ n ≤ p and GCD(p, n) = 1 is a Fermat liar.

In an infinite set of odd composite numbers called Carmichael numbers, every relatively prime smaller number is a Fermat liar. In other words, p is a Carmichael number if p is odd and every n where 1 < n < p and GCD(p, n) = 1 is a Fermat liar.
09/20/2013
53 Error in Text
The solution to Exercise 14 (the CarmichaelNumbers program)
```
// Check for Carmichael numbers.
for (int i = 2; i < maxNumber; i++)
```

Should be the following (to check for only odd Carmichael numbers):
```    // Check for Carmichael numbers.
for (int i = 3; i < maxNumber; i += 2)
```
09/20/2013
53 Error in Text
Inside the IsCarmichael method:

```
// Check all possible witnesses.
for (int i = 1; i < number - 1; i++)
```

Should be this:
```    // Check all possible witnesses.
for (int i = 2; i < number; i++)
```
09/20/2013
238 Text Correction
First sentence on page 238 of the print edition reads:
Binary trees have four kinds of traversals: preorder, inorder, postorder, and depth-first. This should be:
Binary trees have four kinds of traversals: preorder, inorder, postorder, and breadth-first.
04/02/15
10 243 Error in Text
Throughout this section, depth-first traversal should be breadth-first traversal. A breadth-first traversal visits all of the nodes across the breadth of one level before moving down to the next level in the tree. All of the other algorithms (preorder, inorder, and postorder) are actually depth-first traversals.
09/05/2013
487 Errata in Text   