public IDeque <T> EnqueueRight(T value) { return((myRight.IsFull) ? new Deque <T>(myLeft, myMiddle.EnqueueRight(myRight), new One(value), myLongCount + 1) : new Deque <T>(myLeft, myMiddle, myRight.EnqueueRight(value), myLongCount + 1) ); }
public IDeque <T> EnqueueRight(T value) { if (!Right.Full) { return(new Deque <T>(Left, Middle, Right.EnqueueRight(value))); } return(new Deque <T>( Left, Middle.EnqueueRight(Right.DequeueRight()), new Two(Right.PeekRight(), value))); }