The comment on the breadth-first traversal is incorrect. It only works for Binary Tree but not Top-Down Tree.
I want these inputs ['H', 'i', ' ', 't', 'h', 'E', 'r', 'e'] into a breadth-first traversal when it called the function (Read every level from left to right). Any suggestions?
Oh, for 'H', 'i', ' ', 't', 'h', 'E', 'r', 'e', it should be read every level.
(Like 'H' has a first child 'i' and its sibling 't'.
'i' has a first child ' '.
't' has a first child 'h' and its siblings 'r' and 'e'.
'h' has a first child 'E')