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

Method PostOrder

structure/tree/rbtree.go:108–112  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

106
107// PostOrder traverses the tree in the following order Left --> Right --> Root
108func (t *RB[T]) PostOrder() []T {
109 traversal := make([]T, 0)
110 postOrderRecursive[T](t.Root, t._NIL, &traversal)
111 return traversal
112}
113
114// LevelOrder returns the level order traversal of the tree
115func (t *RB[T]) LevelOrder() []T {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected