use preorder traversal,AC