master-algorithms-py/trees/bt_inorder.py
2023-08-08 13:36:28 -07:00

12 lines
212 B
Python

#!/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)