This function performs an inorder traversal of a BST
(root: Optional[Node])
| 3 | |
| 4 | |
| 5 | def inorder(root: Optional[Node]) -> None: |
| 6 | """This function performs an inorder traversal of a BST""" |
| 7 | |
| 8 | # The inorder traversal of a BST is the nodes in increasing order |
| 9 | if root is None: |
| 10 | return |
| 11 | |
| 12 | # Traverse the left subtree |
| 13 | inorder(root.left) |
| 14 | |
| 15 | # Print the root node |
| 16 | print(root.data) |
| 17 | |
| 18 | # Traverse the right subtree |
| 19 | inorder(root.right) |
nothing calls this directly
no outgoing calls
no test coverage detected