# Errata: Data Structures and Algorithms Book!

**URL:** <https://forum.kirupa.com/t/errata-data-structures-and-algorithms-book/663668>\
**Category:** programming\
**Created:** [December 15, 2023, 3:54am UTC](https://forum.kirupa.com/t/errata-data-structures-and-algorithms-book/663668 "2023-12-15T03:54:20Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [February 22, 2024, 6:22am UTC](https://forum.kirupa.com/t/errata-data-structures-and-algorithms-book/663668/8 "2024-02-22T06:22:06Z")

</div>

**Binary Tree Traversal code has two mistakes:**

1. In `breadthFirstTraversal`, the line `observed.enqueue(root)` should be `discovered.enqueue(root)`

2. In `depthFirstTraversal`, if you are using the `Stack` implementation from the book as opposed to including the one from [kirupa.com](http://kirupa.com), you will be missing the `length` method.

Both of these issues are fixed in the version of the full example shared here: [kirupa/data\_structures\_algorithms/binary\_tree\_traversal.htm at master · kirupa/kirupa · GitHub](https://github.com/kirupa/kirupa/blob/master/data_structures_algorithms/binary_tree_traversal.htm)

Thanks again to @timfrobisher for [pointing these two issues](http://forum.kirupa.com/t/two-bugs-in-linkedlist-data-structure-in-absolute-beginners-guide-to-algorithms/665046/5) out.

---

_[View the full topic](https://forum.kirupa.com/t/errata-data-structures-and-algorithms-book/663668)._
