# Errors and comments

**URL:** <https://forums.kodeco.com/t/errors-and-comments/42123>\
**Category:** Data Structures & Algorithms in Swift\
**Created:** [May 1, 2018, 4:12pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123 "2018-05-01T16:12:23Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphdean](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ralphdean/32/81494_2.png) [@ralphdean](https://forums.kodeco.com/u/ralphdean)\
**Post date:** [May 1, 2018, 4:12pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/1 "2018-05-01T16:12:23Z")

</div>

Page 108 and 110. Shouldn’t the right hand node under 50 be something larger than 50 rather than 35? Later on page 110 it is 55 and not 35.

---

<div class="post-metadata">

**Author:** ![ralphdean](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ralphdean/32/81494_2.png) [@ralphdean](https://forums.kodeco.com/u/ralphdean)\
**Post date:** [May 3, 2018, 5:32pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/2 "2018-05-03T17:32:13Z")

</div>

Grammer on pg 213  
“It’ i’s very easy to get the weight of an edge;”

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [May 29, 2018, 7:22pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/3 "2018-05-29T19:22:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brianlawson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/brianlawson/32/81494_2.png) [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Post date:** [June 22, 2018, 2:39pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/4 "2018-06-22T14:39:36Z")

</div>

There is a typo on page 45 in the .pdf and 67 in the epub version. At the bottom of the page, in the last sentence of the next to the last paragraph, is printed, “you’ll bad glad to know…”. I’m betting you meant “you’ll **be** glad…”

---

<div class="post-metadata">

**Author:** ![brianlawson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/brianlawson/32/81494_2.png) [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Post date:** [June 22, 2018, 3:08pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/5 "2018-06-22T15:08:56Z")

</div>

Incomplete sentence on pages 48/73 (pdf/epub) in the “Less is more” section, 2nd paragraph: “However, since you can write an initializer that just sets the underlying private storage.”

---

<div class="post-metadata">

**Author:** ![brianlawson](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/brianlawson/32/81494_2.png) [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Post date:** [June 22, 2018, 7:10pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/6 "2018-06-22T19:10:24Z")

</div>

On page 101 of the pdf the first sentence of the “Where to go from here?” section reads: “The BST is a powerful data structure that **can delivers** great performance”.

Either it can deliver or it delivers, not both. 😉

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [June 29, 2018, 4:15pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/7 "2018-06-29T16:15:05Z")

</div>

Thank you for catching these. They will be fixed soon.

---

<div class="post-metadata">

**Author:** ![doncl](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/doncl/32/102075_2.png) [@doncl](https://forums.kodeco.com/u/doncl)\
**Post date:** [July 15, 2018, 11:58pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/8 "2018-07-15T23:58:51Z")

</div>

So, I think the AVL tree right-left rotation text and image are both in error on. page 119 of the hardcopy (it’s still in error in the latest pdf). The diagram caption in the middle says "Left rotation on 37’, which should be ‘right rotation on 37’, since it’s a right-left rotation. Also, the diagram is confusing - it shows 37 as a left child of 36 after the first pivot, which is incorrect, it should be the right child.

On the next page (120), where it shows a similar diagram for left-right rotations, the image caption is correct (it says 'left rotate of 10), but the image still seems wrong - it shows 10 as a right child of 15 after the initial left rotate, whereas I believe 10 should now be the left child of 15.

If I got my lefts and rights mixed up here explaining it, forgive me, my head is spinning right now, but I’m pretty sure I’ve got it straight now :). In any case, I believe if you look at page 119-120, you can quickly confirm/deny if my correction is itself correct :).

Thanks for a great book.

---

<div class="post-metadata">

**Author:** ![kelvin\_lau](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kelvin_lau/32/109371_2.png) [@kelvin\_lau](https://forums.kodeco.com/u/kelvin_lau)\
**Post date:** [July 19, 2018, 5:41pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/9 "2018-07-19T17:41:23Z")

</div>

As of yesterday, the latest release should rectify that issue! Sorry for the confusion.

---

<div class="post-metadata">

**Author:** ![doncl](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/doncl/32/102075_2.png) [@doncl](https://forums.kodeco.com/u/doncl)\
**Post date:** [July 19, 2018, 6:07pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/10 "2018-07-19T18:07:04Z")

</div>

Thanks, Kelvin. Once again, awesome book.

---

<div class="post-metadata">

**Author:** ![ivangodfather](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ivangodfather/32/81494_2.png) [@ivangodfather](https://forums.kodeco.com/u/ivangodfather)\
**Post date:** [November 18, 2018, 6:01pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/11 "2018-11-18T18:01:45Z")

</div>

Binary Tree Solutions (Chapter 13)  
return 1 + max(height(of: tree.leftChild), height(of: tree.rightChild))  
It should be:  
return 1 + max(height(of: **node**.leftChild), height(of: **node**.rightChild))

---

<div class="post-metadata">

**Author:** ![ivangodfather](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ivangodfather/32/81494_2.png) [@ivangodfather](https://forums.kodeco.com/u/ivangodfather)\
**Post date:** [November 18, 2018, 6:03pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/12 "2018-11-18T18:03:07Z")

</div>

Btw, great book so far! Just for curious, can you give a real world example where a linked list makes sense to use?

---

<div class="post-metadata">

**Author:** ![ivangodfather](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ivangodfather/32/81494_2.png) [@ivangodfather](https://forums.kodeco.com/u/ivangodfather)\
**Post date:** [November 19, 2018, 3:29pm UTC](https://forums.kodeco.com/t/errors-and-comments/42123/13 "2018-11-19T15:29:30Z")

</div>

Errata  
On page 341:  
// 3

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

But as stated in page 117:  
• The value of a left child must be less than the value of its parent.  
Consequently, the value of a right child must be greater than or equal to the value of its parent.

So it should be: tree.value \< min and tree.value \>= max, cause the leftChild should always be less that parent, and the rightChild could also be equal.

---

<div class="post-metadata">

**Author:** ![gdelarosa](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/gdelarosa/32/109063_2.png) [@gdelarosa](https://forums.kodeco.com/u/gdelarosa)\
**Post date:** [November 20, 2018, 12:44am UTC](https://forums.kodeco.com/t/errors-and-comments/42123/14 "2018-11-20T00:44:09Z")

</div>

Hi @ivangodfather, that’s a great question! One example I could think of is a web browser that has a history feature. When you check the history you can go back, you are fetching the previous node.

Best,  
Gina

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [November 20, 2018, 2:04am UTC](https://forums.kodeco.com/t/errors-and-comments/42123/15 "2018-11-20T02:04:03Z")

</div>

@ivangodfather Thank you for catching these - much appreciated. We will definitely fix them in the next version of the book.
