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

Method PreOrder

structure/tree/avl.go:95–99  ·  view source on GitHub ↗

PreOrder Traverses the tree in the following order Root --> Left --> Right

()

Source from the content-addressed store, hash-verified

93
94// PreOrder Traverses the tree in the following order Root --> Left --> Right
95func (avl *AVL[T]) PreOrder() []T {
96 traversal := make([]T, 0)
97 preOrderRecursive[T](avl.Root, avl._NIL, &traversal)
98 return traversal
99}
100
101// InOrder Traverses the tree in the following order Left --> Root --> Right
102func (avl *AVL[T]) InOrder() []T {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected