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

Method AccessNodesByLayer

structure/tree/rbtree.go:122–124  ·  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

120
121// AccessNodesByLayer accesses nodes layer by layer (2-D array), instead of printing the results as 1-D array.
122func (t *RB[T]) AccessNodesByLayer() [][]T {
123 return accessNodeByLayerHelper[T](t.Root, t._NIL)
124}
125
126// Depth returns the calculated depth of a Red-Black tree
127func (t *RB[T]) Depth() int {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected