Simple Queues

Saturday, January 07 2017 immutable-types csharp

Thinking about the functionality we need from a simple immutable queue, we need to easily add a new item onto the end of the queue, and to easily remove an existing item from the front of the queue.

Read more »

Reversing Stacks

Saturday, January 14 2017 immutable-types csharp

It turns out that I omitted the implementation of .Reverse() from my recent post Immutable Stacks Miscellany. Given that a friend has identified an alternative way to implement this, we’ll take a minor detour.

Read more »

Enumeration of Queues

Saturday, January 21 2017 immutable-types csharp

We previously enabled enumeration of our immutable stacks - we should do the same for our immutable queues. Unfortunately, it’s a bit more complicated this time around. (For those looking to the solution to the puzzle posed at the end of my earlier post, you’ll need to wait until next time - but read to the end of this post for a clue.)

Read more »

The Problem with the Simple Queue

Saturday, January 28 2017 immutable-types csharp

In my posts Simple Immutable Queues and Enumeration of Immutable Queues I’ve alluded to a nasty flaw that’s waiting to bite. What is that flaw, and why do we need to worry?

Read more »