refine non-recursive traveral on binary tree