# Errata for Data Structures and Algorithms in Swift, 3rd Edition

**URL:** <https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656>\
**Category:** Data Structures & Algorithms in Swift\
**Created:** [October 2, 2019, 7:04pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656 "2019-10-02T19:04:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisrazeware](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/chrisrazeware/32/107900_2.png) [@chrisrazeware](https://forums.kodeco.com/u/chrisrazeware)\
**Post date:** [October 2, 2019, 7:04pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656/1 "2019-10-02T19:04:35Z")

</div>

The official errata thread for Data Structures and Algorithms, 3rd edition!

---

<div class="post-metadata">

**Author:** ![chrisrazeware](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/chrisrazeware/32/107900_2.png) [@chrisrazeware](https://forums.kodeco.com/u/chrisrazeware)\
**Post date:** [October 2, 2019, 7:04pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656/2 "2019-10-02T19:04:42Z")

</div>

Pinned on October 2, 2019, 7:04pm UTC



---

<div class="post-metadata">

**Author:** ![snehanshu](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/snehanshu/32/89840_2.png) [@snehanshu](https://forums.kodeco.com/u/snehanshu)\
**Post date:** [April 17, 2020, 5:32am UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656/3 "2020-04-17T05:32:03Z")

</div>

Loving the book so far, thank you!  
Here are some corrections needed in Chapter 6, Linked List code on page 83:

private mutating func copyNodes(returningCopyOf node: Node?) → Node? {  
guard !isKnownUniquelyReferenced(&head) else {  
**return node // The book has a nil here, so appending to uniquely referenced lists does not work**  
}  
guard var oldNode = head else {  
return nil  
}  
head = Node(value: oldNode.value)  
var newNode = head  
var nodeCopy: Node?  
while let nextOldNode = oldNode.next {  
if oldNode === node {  
nodeCopy = newNode  
}  
newNode!.next = Node(value: nextOldNode.value)  
newNode = newNode!.next  
oldNode = nextOldNode  
}  
**tail = newNode // Updating the tail is missing in the book**  
return nodeCopy  
}

---

<div class="post-metadata">

**Author:** ![ingo69](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ingo69/32/100086_2.png) [@ingo69](https://forums.kodeco.com/u/ingo69)\
**Post date:** [May 18, 2020, 10:30pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656/4 "2020-05-18T22:30:17Z")

</div>

I found the book to be minimally helpful. It had minimal insight and minimal explanations of the algorithms. It would have been better to have less examples and more detail. I mean just try too decipher this:  
extension LinkedList {  
mutating func reverse() {  
tail = head // reassign head to tail position  
var prev = head  
var current = head?.next  
prev?.next = nil

```
  while current != nil {
    let next = current?.next
    current?.next = prev
    prev = current
    current = next
  }
}

```

}

The naming system of the variables leaves a lot to be desired and is very confusing. I have 3 apps on the app store and have been doing IOS for 3 years. The video and articles are way more clearer on the website. This book feels rushed.

---

<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:** [July 6, 2020, 11:27pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656/5 "2020-07-06T23:27:17Z")

</div>

@ingo69 Thank you for your feedback - much appreciated!

---

<div class="post-metadata">

**Author:** ![jcabrera](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jcabrera/32/109112_2.png) [@jcabrera](https://forums.kodeco.com/u/jcabrera)\
**Post date:** [September 27, 2020, 6:52pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656/6 "2020-09-27T18:52:13Z")

</div>

Some small issues I’ve found (will add to the list as I go through the book):

- In the index of Section II, Stack is mentioned to be Chapter 4, but the title of that chapter (right on the next page) says Chapter 6. Also, in the Stack Operations part it says “If you had a tough time with the linked list concepts, you’ll be glad to know that stacks are comparatively trivial.” but the linked list now goes afterwards (I guess it was moved?)

- Seems like in the .epub version a lot of lists have their last item be 1 instead of the correct numeration. For example:

- It seems like in Xcode 12, source files in a playground are not able to “see” each other, so if you open the finished LinkedList.playground you’ll find in LinkedList.swift that it shows the error “Cannot find type ‘Node’ in scope” even if Node is marked as public in Node.swift.

- The missing tail updating that @snehanshu already pointed out

---

<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:** [June 29, 2021, 2:59pm UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656/7 "2021-06-29T14:59:04Z")

</div>

Possible error with print statement shared by @amberspades. [Section 1 Chp 2.2](https://forums.kodeco.com/t/section-1-chp-2-2/143098)

---

<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:** [September 15, 2021, 12:04am UTC](https://forums.kodeco.com/t/errata-for-data-structures-and-algorithms-in-swift-3rd-edition/83656/8 "2021-09-15T00:04:47Z")

</div>

Closed on September 15, 2021, 12:04am UTC


