add stack and iterative divide and conquer