We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc18bf6 commit aa900e3Copy full SHA for aa900e3
1 file changed
Linked List/README.markdown
@@ -451,6 +451,7 @@ How about reversing a list, so that the head becomes the tail and vice versa? Th
451
```swift
452
public func reverse() {
453
var node = head
454
+ tail = node // If you had a tail pointer
455
while let currentNode = node {
456
node = currentNode.next
457
swap(¤tNode.next, ¤tNode.previous)
0 commit comments