LevelOrder returns the level order traversal of the tree
()
| 112 | |
| 113 | // LevelOrder returns the level order traversal of the tree |
| 114 | func (avl *AVL[T]) LevelOrder() []T { |
| 115 | traversal := make([]T, 0) |
| 116 | levelOrderHelper[T](avl.Root, avl._NIL, &traversal) |
| 117 | return traversal |
| 118 | } |
| 119 | |
| 120 | // AccessNodesByLayer accesses nodes layer by layer (2-D array), instead of printing the results as 1-D array. |
| 121 | func (avl *AVL[T]) AccessNodesByLayer() [][]T { |
nothing calls this directly
no outgoing calls
no test coverage detected