Create bt_inorder.py

This commit is contained in:
bt3gl 2023-08-08 13:36:28 -07:00 committed by GitHub
parent b1a9367ee4
commit 9486e25675
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

11
trees/bt_inorder.py Normal file
View File

@ -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)