MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / AccessNodesByLayer

Method AccessNodesByLayer

structure/tree/bstree.go:113–115  ·  view source on GitHub ↗

AccessNodesByLayer accesses nodes layer by layer (2-D array), instead of printing the results as 1-D array.

()

Source from the content-addressed store, hash-verified

111
112// AccessNodesByLayer accesses nodes layer by layer (2-D array), instead of printing the results as 1-D array.
113func (t *BinarySearch[T]) AccessNodesByLayer() [][]T {
114 return accessNodeByLayerHelper[T](t.Root, t._NIL)
115}
116
117// Depth returns the calculated depth of a binary search tree
118func (t *BinarySearch[T]) Depth() int {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected