From 9486e256756c969bb1b25161a6a6707124ad5c9b Mon Sep 17 00:00:00 2001 From: bt3gl <138340846+bt3gl-cryptographer@users.noreply.github.com> Date: Tue, 8 Aug 2023 13:36:28 -0700 Subject: [PATCH] Create bt_inorder.py --- trees/bt_inorder.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 trees/bt_inorder.py diff --git a/trees/bt_inorder.py b/trees/bt_inorder.py new file mode 100644 index 0000000..619f1c2 --- /dev/null +++ b/trees/bt_inorder.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# author: bt3gl + +def inorder(root) -> list: + + if root is None: + return [] + + return inorder(root.left) + [root.val] + inorder(root.right) +