mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-07-01 18:17:02 -04:00
11 lines
219 B
Python
11 lines
219 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
# author: bt3gl
|
|
|
|
def postorder(root) -> list:
|
|
|
|
if root is None:
|
|
return []
|
|
|
|
return postorder(root.left) + postorder(root.right) + [root.val]
|
|
|