Пример #1
0
 public void Left(int k)
 {
     for (int i = 0; i < k; i++)
     {
         _rightCharacters.Push(_leftCharacters.Pop());
     }
 }
        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 )");
        }
Пример #3
0
 public void Insert(char c)
 {
     _leftCharacters.Push(c);
 }