Iterative
Special Stacks
reverse stack - use a temp stack to reverse the order of insertion
Iterator in Java
Iterator normally has two main functions hasNext()
and next()
. We use stack to simulate the steps in a recursion.
Iterator in Python
Last updated