# Errata for Data Structures and Algorithms in Kotlin 1st Edition

**URL:** <https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124>\
**Category:** Data Structures and Algorithms in Kotlin\
**Created:** [September 18, 2019, 1:37pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124 "2019-09-18T13:37:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mandafrederick](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mandafrederick/32/102369_2.png) [@mandafrederick](https://forums.kodeco.com/u/mandafrederick)\
**Post date:** [September 18, 2019, 1:37pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/1 "2019-09-18T13:37:25Z")

</div>

Creating this topic to catch any typos and bugs in the 1st Edition of Data Structures and Algorithms in Kotlin.

---

<div class="post-metadata">

**Author:** ![mandafrederick](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mandafrederick/32/102369_2.png) [@mandafrederick](https://forums.kodeco.com/u/mandafrederick)\
**Post date:** [September 18, 2019, 1:37pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/2 "2019-09-18T13:37:34Z")

</div>

Pinned on September 18, 2019, 1:37pm UTC



---

<div class="post-metadata">

**Author:** ![kebabkrabby](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kebabkrabby/32/81494_2.png) [@kebabkrabby](https://forums.kodeco.com/u/kebabkrabby)\
**Post date:** [April 2, 2020, 9:24am UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/3 "2020-04-02T09:24:27Z")

</div>

I have bought printed version for 60 dollars and to be honest i have found there quite a lot mistakes and some typos, but what disappointed me the most that the source code link is dead and you have nothing on your github…

How is this even possible?

**Link from book:**

> [www.raywenderlich.com/store/data-structures-and-algorithms-in-kotlin-source-code/](http://www.raywenderlich.com/store/data-structures-and-algorithms-in-kotlin-source-code/)

---

<div class="post-metadata">

**Author:** ![mandafrederick](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mandafrederick/32/102369_2.png) [@mandafrederick](https://forums.kodeco.com/u/mandafrederick)\
**Post date:** [April 3, 2020, 1:26am UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/4 "2020-04-03T01:26:55Z")

</div>

Hello, @kebabkrabby,

Thank you for reaching out regarding this book.

Firstly, I apologize for any mistakes that slipped through our editorial process! We’d love to hear any examples or feedback so we can them fixed up in the next update.

Additionally, here is the correct source code link: [https://store.raywenderlich.com/products/data-structures-and-algorithms-in-kotlin-source-code](https://store.raywenderlich.com/products/data-structures-and-algorithms-in-kotlin-source-code)

It seems the word “products” was switched out for “store.” I will get the frontmatter of the book updated ASAP to Amazon.

Regarding the GitHub, we don’t traditionally store materials there for the book.

Thank you, again. Please let me know if you have any further issues accessing the materials!

Best,  
Manda  
Managing Editor

---

<div class="post-metadata">

**Author:** ![arrmixer](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/arrmixer/32/108693_2.png) [@arrmixer](https://forums.kodeco.com/u/arrmixer)\
**Post date:** [November 12, 2020, 4:03pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/5 "2020-11-12T16:03:23Z")

</div>

Errata for Chapter 10

the remove function has a couple of minor mistakes such as CollectionType should be List.  
Here is the correct version:

```
fun remove(collection: List<Key>) {
        // 1
        var current = root

        collection.forEach {
            val child = current.children[it] ?: return
            current = child
        }

        if (!current.isTerminating) return

        // 2
        current.isTerminating = false

        // 3
        val parent = current.parent
        while (current.children.isEmpty() && !current.isTerminating) {
            parent?.let {
                it.children.remove(current.key)
                current = it
            }
        }
    }

```

---

<div class="post-metadata">

**Author:** ![sjoerg](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/sjoerg/32/81494_2.png) [@sjoerg](https://forums.kodeco.com/u/sjoerg)\
**Post date:** [June 29, 2021, 6:20pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/6 "2021-06-29T18:20:48Z")

</div>

There is a minor left-right-typo in Chapter 8, page 192, in the implementation of the function leftRightRotate.  
See also

> <https://github.com/raywenderlich/dsk-materials/blob/editions/1.0/09-avl-trees/projects/final/src/AVLTree.kt>

The third line of the function should be  
node.leftChild = leftRotate(leftChild)  
instead of  
node.leftChild = rightRotate(leftChild)

---

<div class="post-metadata">

**Author:** ![jellodiil](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jellodiil/32/109742_2.png) [@jellodiil](https://forums.kodeco.com/u/jellodiil)\
**Post date:** [June 29, 2021, 11:28pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/7 "2021-06-29T23:28:00Z")

</div>

Unpinned on June 29, 2021, 11:28pm UTC



---

<div class="post-metadata">

**Author:** ![jellodiil](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jellodiil/32/109742_2.png) [@jellodiil](https://forums.kodeco.com/u/jellodiil)\
**Post date:** [June 30, 2021, 3:37pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/8 "2021-06-30T15:37:27Z")

</div>

Hey there,

Thank you for pointing out this error — it has been corrected in the 2nd edition, which is now available 🙂

---

<div class="post-metadata">

**Author:** ![jellodiil](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jellodiil/32/109742_2.png) [@jellodiil](https://forums.kodeco.com/u/jellodiil)\
**Post date:** [June 30, 2021, 3:39pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-kotlin-1st-edition/82124/9 "2021-06-30T15:39:17Z")

</div>

Closed on June 30, 2021, 3:39pm UTC


