Esempio n. 1
0
 public IDeque <T> EnqueueLeft(T value)
 {
     return((myLeft.IsFull)
                         ? new Deque <T>(new One(value), myMiddle.EnqueueLeft(myLeft), myRight, myLongCount + 1)
                         : new Deque <T>(myLeft.EnqueueLeft(value), myMiddle, myRight, myLongCount + 1)
            );
 }
Esempio n. 2
0
 public IDeque <T> EnqueueLeft(T value)
 {
     if (!Left.Full)
     {
         return(new Deque <T>(Left.EnqueueLeft(value), Middle, Right));
     }
     return(new Deque <T>(
                new Two(value, Left.PeekLeft()),
                Middle.EnqueueLeft(Left.DequeueLeft()),
                Right));
 }