So let's try to summarize what we've learned about the iterative design patterns so we saw that in general
an object can be iterated or traversed if it defines begin and Para's and these begin in and Para's
they themselves return eatery tours.
So an iterator defines how you can actually traverse a particular object So for example for a binary
tree you can have three different types of Traverse so you can have in order pre or post order you can
also invent your own kinds of traversals and for each of those traversals you can expose a different
kind of iterator.
Now is that really all that's required from an iterator is to implement that not equals and plus bus
operators.
That's the bare minimum that you would define in order to actually have a functioning iterator.
Now there is a problem with the plus plus because remember the plus plus operator is called sporadically
you could have it being called one so you could have it being called the whole number of times and in
between these calls there is no way of efficiently preserving the stack if you're talking about kind
of recursion.
And unfortunately if we're talking about traversing a tree you do want recursion but with the plus plus
operator defined as it is as it is required you cannot actually get your algorithms to be recursive
but there is salvation on the horizon in the form of carotenes because essentially carotenes allow you
to suspend execution.
So the idea of Cofield is that you yield a value and then you suspend execution until somebody asks
for the next value but you're not really exiting that particular method.
So you get to resume inside that method.
And as a consequence you finally get recursion and you finally get to write those recursive algorithms
in a way that they can be actually readable.