Enqueue recursively appends al tree.N and the children's tree.N to a slice
(nodes []tree.N)
| 169 | |
| 170 | // Enqueue recursively appends al tree.N and the children's tree.N to a slice |
| 171 | func (t *TreeNode) Enqueue(nodes []tree.N) []tree.N { |
| 172 | nodes = append(nodes, t.N) |
| 173 | if !t.IsLeaf() { |
| 174 | for _, c := range t.SortedChildren() { |
| 175 | nodes = c.Enqueue(nodes) |
| 176 | } |
| 177 | } |
| 178 | return nodes |
| 179 | } |
| 180 | |
| 181 | // SortedChildren sorts children by their labels. An internal flag avoids resorting if |
| 182 | // it was already sorted once. |
nothing calls this directly
no test coverage detected