MCPcopy
hub / github.com/TheAlgorithms/Go / postOrderRecursive

Function postOrderRecursive

structure/tree/tree.go:96–104  ·  view source on GitHub ↗
(n, nilNode Node[T], traversal *[]T)

Source from the content-addressed store, hash-verified

94}
95
96func postOrderRecursive[T constraints.Ordered](n, nilNode Node[T], traversal *[]T) {
97 if n == nilNode {
98 return
99 }
100
101 postOrderRecursive(n.Left(), nilNode, traversal)
102 postOrderRecursive(n.Right(), nilNode, traversal)
103 *traversal = append(*traversal, n.Key())
104}
105
106func calculateDepth[T constraints.Ordered](n, nilNode Node[T], depth int) int {
107 if n == nilNode {

Callers

nothing calls this directly

Calls 3

LeftMethod · 0.65
RightMethod · 0.65
KeyMethod · 0.65

Tested by

no test coverage detected