The immutable stack implementation we wrote in Immutable Stacks doesn’t provide consumers with an easy way to iterate through everything on the stack. We can (and should) remedy this by implementing
Before we move on to other kinds of immutable data structures, some miscellany about how we might improve on the
ImmutableStack<T> we already have - or perhaps just do things differently. All of these observations were submitted by blog readers - thanks everyone for the feedback.
Moving on from our discussion of immutable stacks, let us look at how to effectively implement an
ImmutableQueue<T>. What can the exercise teach us?