public Iterator(StackImplementedByLinkedList <T> outerClass)
 {
     _outerClassInstance = outerClass;
     _current            = new Node
     {
         Item = default(T),
         Next = _outerClassInstance.first
     };
 }
        public static void RunClient(string sample)
        {
            StackImplementedByLinkedList <string> s = new StackImplementedByLinkedList <string>();
            var items = sample.Split(' ').ToList();

            foreach (var item in items)
            {
                if (item != "-")
                {
                    s.Push(item);
                }
                else if (!s.IsEmpty())
                {
                    Console.Write(s.Pop() + " ");
                }
            }

            Console.WriteLine("(" + s.Size() + " left on stack )");
        }
Ejemplo n.º 3
0
 public Buffer()
 {
     _leftCharacters  = new StackImplementedByLinkedList <char>();
     _rightCharacters = new StackImplementedByLinkedList <char>();
 }