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

Method PostOrder

structure/tree/bstree.go:99–103  ·  view source on GitHub ↗

PostOrder traverses the tree in the following order Left --> Right --> Root

()

Source from the content-addressed store, hash-verified

97
98// PostOrder traverses the tree in the following order Left --> Right --> Root
99func (t *BinarySearch[T]) PostOrder() []T {
100 traversal := make([]T, 0)
101 postOrderRecursive[T](t.Root, t._NIL, &traversal)
102 return traversal
103}
104
105// LevelOrder returns the level order traversal of the tree
106func (t *BinarySearch[T]) LevelOrder() []T {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected