iterative pre traversal using stack