Write a program binary_traversal_demo.py
that:
preorder()
inorder()
postorder()
As an example consider this binary tree:
a
/ \
/ \
/ \
/ \
b c
/ \ / \
/ \ / \
d e f g
/ \ \ /
h i j k
Calling the preorder()
function on this tree would return the result [a, b, d, h, i, e, j, c, f, g, k]
.