If you saw in the book is the next information
but if you saw Queue is an interface and in the final folder of the chapter we can see this
fun forEachLevelOrder(visit: Visitor<T>) {
visit(this)
val queue = ArrayListQueue<TreeNode<T>>()
children.forEach { queue.enqueue(it) }
var node = queue.dequeue()
while (node != null) {
visit(node)
node.children.forEach { queue.enqueue(it) }
node = queue.dequeue()
}
}
Plis fix this on the book
Cheers,
Happy Coding