Chapter  Page  Edition  Details 
 
 
ePub/iPad 
The formulas that are not contained in paragraphs seem to be fuzzy. I think this is a technical issue. I suspect eReader devices cannot render complex formulas so the formulas are included as images. That means they may get fuzzy if you zoom in or out. Aorry about that but I don't think there's anything we can do about this.

1 
na 
ePub/iPad 
While discussing Big O notation, the italicized restatement of Rule #4 says:
... the algorithm's total performance is O(f(N) + g(N)).
That should read:
... the algorithm's total performance is O(f(N) × g(N)).

1 
12 
Print 
The end of the first paragraph after the "Logarythms" box says:
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.

1 
14 
Print 
The fourth paragraph says:
A full complete binary tree of height H has 2^{H} nodes.
This text was trying to be approximate so it should have said the tree has approximately 2^{H} nodes. More precisely a full complete binary tree of height H has 2^{H+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 lookign at Big O notation, a full complete binary tree containing N nodes has height roughly log_{2}(N). More precisely the height is log_{2}(N + 1)  1. (See the third bullet point on page 232.)

1 
14 
Both 
The middle of the page says:
Setting B = 2, you can use this formula to convert the value O(Log_{2}(N) into any other log base A:
This should be:
Setting B = 2, you can use this formula to convert the value O(Log_{2}(N)) into any other log base A:

1 
17 
Print 
The column of values for the factorial function N! is wrong. The correct values are:
N  N! 
1  1 
5  120 
10  3.6×10^{6} 
15  1.3×10^{12} 
20  2.4×10^{18} 
50  3.0×10^{64} 
100  9.3×10^{157} 
1000  – 
10000  – 
100000  – 

2 
40 
Print 
The fourth paragraph in the section "Testing for Primality" says:
Fermat's "little theorem" states that if p is prime and 1 ≤ n ≤ p, n^{p1} Mod p = 1.
This should say:
Fermat's "little theorem" states that if p is prime and 1 ≤ n < p, n^{p1} Mod p = 1.

2 
36 
Print 
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.
This should read:
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.

2 
39 
Print 
The FindPrimes algorithm uses this code:
While (next_prime < stop_at)
This should be:
While (next_prime <= stop_at)
You should make the corresponding correction to example program SieveOfEratosthenes. (To see the problem, enter 9 for the maximum number.)

2 
53 
Print 
Exercise 14 says:
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.
This should read:
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.

2 
53 
Print 
The solution to Exercise 14 (the CarmichaelNumbers program) can be improved. This code:
// 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)
Inside the IsCarmichael method, this code:
// 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++)

10 
243 
Print 
Throughout that section, depthfirst traversal should be breadthfirst traversal. A breadthfirst 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 depthfirst traversals.

30 
na 
ePub/Kindle 
I think this may have been a translation error when the eBook edition was created. I think the text is a bit different in the print edition. The eBook version looks something like this:
For example, to get a value between 1 and 100, you would calculate the following:
result = Min + (Number / M) * (Max  Min)
The problem with this is that it may make some results more likely than others.
In the print edition, that text looks like this:
Usually a program needs a random number within a range other than 0
to M. An obvious but bad way to map a number produced by the generator into
a range Min to Max is to use the following equation:
result = Min + number Mod (Max  Min + 1)
For example, to get a value between 1 and 100, you would calculate the
following:
result = 1 + number Mod (100  1 + 1)
The problem with this is that it may make some results more likely than others.
The key difference is the parts of the equation highlighted in red.
I think with that change it makes sense. Please let me know if it doesn't make sense to you.

App B 
488 
Print 
The solution to exercise 13 has the roles of the two algorithms are reversed. The correct solution should be:
The question is, "For what N is 1,500 × N > 30 × N2?" Solving for N gives 50 < N,
so the second algorithm is slower if N > 50. You would use the second algorithm if
N ≤ 50 and the first if N > 50.
