In the third to the last line of the sidebar, "Logarithms", the number 3 should be 4:
So for a list of 8 numbers, you would have to check 4 numbers at most.
The mid statement in the next to the last snippet is missing an / character.
mid = (low + high) // 2
The mid statement in the first snippet is missing /2.
mid = (low + high) / 2
The number of milliseconds in the second line is incorrect. It should be 30:
The values listed under 0(n1) are incorrect:
8.6x10505 years should be 2.7x10498 years
5.4x102638 years should be 1.7x102631 years
The chapter reference in the first para following the sidebar should be chapter 4.
Its coming up in chapter 4!
The 0 in the third line in the second code snippet should be 1:
if i <= 1:
The second def statement in the second code snippet should be alinged with the first def statement:
def greet2(name): print "how are you, " + name + "?" def bye(): print "ok bye!"
The grid is 14 X 8; it should be 21 x 8.
The second sequence iin the partition array is incorrect. The correct sequence is 1, 3, 5, 2, 4.
Add the following to the end of the first paragraph:
You can get the best case consistently, as long as you always choose a random element as the pivot. Read on to find out why.
the print statement is missing the letter t:
print "kick them out!"
The number .07 in the fifth bullet should be 0.7:
Once your load factor is greater than 0.7, it's time to resize your hash table.
The last sentence before the "Trading for a piano" section should read:
Dijkstra's algorithm only works on graphs with no cycles, or on graphs with a positive weight cycle.
>>> print graph["start"]["a"] 6 >>> print graph["start"]["b"] 2
In the first sentence following 2., the word stations should be 2^n subsets:
The problem is, it takes a long time to calculate every possible subset of 2^n subsets.
The annotaton for the second code snippet should point to the first line of code, not the second.
The last two lines of code in the
while snippet at the bottom of the page should align with the for statement.
The first line of the heading for the second column in the table just before the Exercises section should be 0(2^n), not 0(n!).
The currency value in the bottom-left cell of the first grid should be $2000, not $3500.
The value in the bottom-left cell in the first grid (H row) should be 1, not 0.
The value in the bottom-left cell in the second grid (H row) should be 1, not 0.
The answer to 8.4 is No.