MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / postorder

Function postorder

data_structures/binary_tree/binary_search_tree.py:343–350  ·  view source on GitHub ↗

postOrder (left, right, self)

(curr_node: Node | None)

Source from the content-addressed store, hash-verified

341
342
343def postorder(curr_node: Node | None) -> list[Node]:
344 """
345 postOrder (left, right, self)
346 """
347 node_list = []
348 if curr_node is not None:
349 node_list = postorder(curr_node.left) + postorder(curr_node.right) + [curr_node]
350 return node_list
351
352
353if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected