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

Function inorder

data_structures/binary_tree/binary_search_tree.py:333–340  ·  view source on GitHub ↗

inorder (left, self, right)

(curr_node: Node | None)

Source from the content-addressed store, hash-verified

331
332
333def inorder(curr_node: Node | None) -> list[Node]:
334 """
335 inorder (left, self, right)
336 """
337 node_list = []
338 if curr_node is not None:
339 node_list = [*inorder(curr_node.left), curr_node, *inorder(curr_node.right)]
340 return node_list
341
342
343def postorder(curr_node: Node | None) -> list[Node]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected