This is the errata page for the second edition of Grokking Algorithms. If you see an error, please send me an email.

Chapter 7

Page 133: In this Huffman coding example, I use stat to show the number of bytes in a file. I say the command returns 4 bytes, but you may see 5 instead. This is because unix will add a newline (00001010, or '\n') automatically at the end.

Also, if stat -f%z test.txt gives you an error, try stat --format=%s test.txt.

Appendix A: Performance of AVL trees

On Page 266, I say "a perfectly balanced tree of height ... 2 has 7 nodes (32 + 1), of height 3 has 15 nodes (72 + 1), etc." It should be (3*2 + 1) and (7*2 + 1), respectively.

Privacy Policy