The following program implement a steque - a stack-ended queue. It supports push, pop, and enqueue.

using System;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Steque s = new Steque();

            Console.WriteLine("Push(A)");
            s.Push("A");
            s.ShowItems();

            Console.WriteLine("Push(B)");
            s.Push("B");
            s.ShowItems();

            Console.WriteLine("Enqueue(C)");
            s.Enqueue("C");
            s.ShowItems();

            Console.WriteLine("Pop()");
            s.Pop();
            s.ShowItems();

            Console.WriteLine("Pop()");
            s.Pop();
            s.ShowItems();

            Console.WriteLine("Pop()");
            s.Pop();
            s.ShowItems();

            Console.WriteLine("Enqueue(D)");
            s.Enqueue("D");
            s.ShowItems();

            Console.WriteLine("Enqueue(E)");
            s.Enqueue("E");
            s.ShowItems();

            Console.WriteLine("Pop()");
            s.Pop();
            s.ShowItems();

            Console.ReadKey();
        }

        class Steque where T : class
        {
            private Node first; // the top of steque (the most recently pushed node)
            private Node last;  // the end of steque (the most recently enqueued node)
            private int N; // the size of steque (the number of items in the linked list)

            public bool IsEmpty { get { return first == null; } } // the same as N == 0
            public int Size { get { return N; } }

            public void Push(T item)
            {
                // Add item to the top of steque i.e., insert the item at the beginning of the linked list.
                Node oldFirst = first;
                first = new Node();
                first.Item = item;
                first.Next = oldFirst;

                // Adjust the last item if necessary.
                if (oldFirst == null) // check if this is the first item pushed
                    last = first;

                ++N;
            }

            public T Pop()
            {
                // Remove item from the top of steque i.e., remove the item from the beginning of the linked list.
                T item = first.Item;
                first = first.Next;

                // Adjust the last item if necessary.
                if (first == null) // check if this is the last item popped
                    last = null;

                --N;

                return item;
            }

            public void Enqueue(T item)
            {
                // Add item to the end of steque.
                Node oldLast = last;
                last = new Node();
                last.Item = item;
                last.Next = null;

                if (IsEmpty)
                    first = last;
                else
                    oldLast.Next = last;

                ++N;
            }

            // ShowItems traverses all the items in the list.
            public void ShowItems()
            {
                for (Node node = first; node != null; node = node.Next)
                {
                    Console.WriteLine("{0} ", node.Item.ToString());
                }
                Console.WriteLine("First = {0}->{1}", (first != null ? first.Item.ToString() : "null"), (first != null && first.Next != null ? first.Next.Item.ToString() : "null"));
                Console.WriteLine("Last  = {0}->{1}", (last != null ? last.Item.ToString() : "null"), (last != null && last.Next != null ? last.Next.Item.ToString() : "null")); // last.Next should always be null
                Console.WriteLine();
            }

            private class Node
            {
                public T Item { get; set; }
                public Node Next { get; set; }

                public override string ToString() { return (Item == null ? "null" : Item.ToString()); }
            }
        }
    }
}

Output:

Push(A)
A
First = A->null
Last  = A->null

Push(B)
B
A
First = B->A
Last  = A->null

Enqueue(C)
B
A
C
First = B->A
Last  = C->null

Pop()
A
C
First = A->C
Last  = C->null

Pop()
C
First = C->null
Last  = C->null

Pop()
First = null->null
Last  = null->null

Enqueue(D)
D
First = D->null
Last  = D->null

Enqueue(E)
D
E
First = D->E
Last  = E->null

Pop()
E
First = E->null
Last  = E->null