Baidu interview question

Inorder or preorder traverse the binary tree