LevelOrder returns the level order traversal of the tree
()
| 104 | |
| 105 | // LevelOrder returns the level order traversal of the tree |
| 106 | func (t *BinarySearch[T]) LevelOrder() []T { |
| 107 | traversal := make([]T, 0) |
| 108 | levelOrderHelper[T](t.Root, t._NIL, &traversal) |
| 109 | return traversal |
| 110 | } |
| 111 | |
| 112 | // AccessNodesByLayer accesses nodes layer by layer (2-D array), instead of printing the results as 1-D array. |
| 113 | func (t *BinarySearch[T]) AccessNodesByLayer() [][]T { |
nothing calls this directly
no outgoing calls
no test coverage detected