An immutable queue is a bit trickier than an immutable stack, but we're tough, we can handle it. First off, the interface is straightforward; enqueuing or dequeuing results in a new queue: public interface IQueue : IEnumerable { bool IsEmpty { get; } T Peek(); IQueue Enqueue(T value); ...
No comments:
Post a Comment