Feedback / Errata

In v0.9.1, p.99, the “post-swap” diagram has minor mistake: remove dotted line & add solid line between node 27 and 37.
I guess the text on p.98 also is not clear (or is inferred) that once node 27 is swapped into place of deleted node 25, the left and right children (12 and 37) still need to be re-connected to 27 (which originally had no children).

Oh, wait, I see; upon further reading of the code on p.100, I realize now that the swap does not really refer to the node, but rather the node.value.

I think this sentence on p. 98 led me astray:

When removing a node with two children, replace the node you removed with smallest
node in its right subtree.

I would suggest clarifying that to be specific about the node.value; i.e.

When removing a node with two children, replace the value of that node [to be removed] with the
value of the smallest node in its right subtree.

The diagram on p. 98 does mention “Replaced value” but then that diagram also has the relationship lines marked incorrectly.

Hope I’m not being obtuse!

1 Like

Thank you for the heads up - much appreciated! We will fix this in the book’s next release.

I got the 1.0 release today, thank you for that. I’ve found a couple of minor issues though.

  1. The .pdf version of the book does not have any Table of Contents. This makes it difficult to navigate back and forth between the end of the book to check the Challenge answers and back to where you were reading.

  2. The printed ToC is not linked for easy navigation.

  3. The Chapter 4 Linked List Challenge Starter Playground’s Render Documentation option is turned off which disables paging through the Challenge. I have not checked any of the other challenge playgrounds so I can’t say if it is a problem throughout.

Like I said, minor issues but I thought you’d like to know so they can be fixed for the next release.

Thanks @brianlawson!

The table of contents issue is known and it’s a problem with the tool we’re using to render the PDF files. As far as I know, this issue is persisting in other books as well. We’ve backlogged it as a TODO…

Thanks again. I would like to suggest that the start of each chapter include “Chapter n” along with the chapter title just to make clear a new chapter is being started.

Ah, are you reading from the epub?

I am, although I usually check the .pdf before I post here. Didn’t do that this time,

In Chapter 13: Binary Search Trees on pages 115 & 116 are the illustrations correct? They still show the imaginary 3rd link from the root to node 37 from the illustration showing the potential problems with removal. Since those 2 illustrations are now back in the real world of how the removal actually works, shouldn’t the link from node 37 be to the node being removed/updated? This is particularly true of the page 116 illustration showing the finished tree.

Also, there is a difference between the pdf and the ePub versions. On page 109 of the pdf there is a list of 3 steps explaining code we just entered. In the ePub version (I’m showing page 158) the list is numbered

in chapter 35 Graphs
a little word error

There is a blue line in the middle of the matrix. When the row and column are equal, this represents an edge between a vertex and itself, which is not allowed .

in your picture it is a red line, not blue line

after graphs challenges. page 435 ,436 “Section V: Graphs” is duplicated to page 395,396.

1 Like

@yangwulong1978 Thank you for the heads up - much appreciated! We will fix them in the book’s next release.

Binary Search Tree Challenges (Third Edition: page 176)
Solutions to Challenge 1:

Blockquote
A binary search tree is a tree where every left child is less than or equal to its parent, and every right child is greater than its parent.

It should’ve said:

Blockquote
A binary search tree is a tree where every left child is less than to its parent and every right child is greater than or equal than its parent.

Also on the same page, on the actual code:

if let min = min, tree.value < min { 
    return false
} else if let max = max, tree.value >= max {
    return false
}

@helmutrs Thank you for sharing this - much appreciated! I will forward it to the book team.

I think there may be an inadvertent repetition here:

Chapter 7, Solution to Challenge 4, Merging Subsection

“Instead of using using the append or insert methods to insert elements to the list…”