# Errata Chapter 7

**URL:** <https://forums.kodeco.com/t/errata-chapter-7/120606>\
**Category:** Data Structures and Algorithms in Kotlin\
**Created:** [September 21, 2020, 9:12pm UTC](https://forums.kodeco.com/t/errata-chapter-7/120606 "2020-09-21T21:12:29Z")\
**Posts on this page:** 1\
**Page:** 1

<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:** [September 21, 2020, 9:12pm UTC](https://forums.kodeco.com/t/errata-chapter-7/120606/1 "2020-09-21T21:12:29Z")

</div>

Just FYI not a critical error:

The solution code for the deserialization on the first implementation is wrong. The book has the final implementation after the optimization. I realized this as I read on but wasn’t apparent why I was getting the wrong console output compared to the book.

Book Implementation: `fun deserialize(list: MutableList<T?>): BinaryNode<T?>? { val rootValue = list.removeAt(list.size - 1) ?: return null`

correct Implementation:`fun deserialize(list: MutableList<T?>): BinaryNode<T?>? { val rootValue = list.removeAt(0) ?: return null`

also a small error on the deserializationOptimized method’s return type:

Book Implementation: `fun deserializeOptimized(list: MutableList<T?>): BinaryNode<T>? `

correct Implementation:`fun deserializeOptimized(list: MutableList<T?>): BinaryNode<T?>?`
