fixed a bug according to online judge
frame for traverse a BT iteratively