non recursive preorder