non-recursive pre-order traverse

use stack to achieve non-recursive pre-order traverse