Beispiel #1
0
 public void enQueue(T x)
 {
     while (s1.Count() > 0)
     {
         s2.Push(s1.Pop());
     }
     s1.Push(x);
     while (s2.Count() > 0)
     {
         s1.Push(s2.Pop());
     }
 }
Beispiel #2
0
        private static void BasicStackTest()
        {
            BasicStack <int> stack = new BasicStack <int>();

            stack.Push(10);
            stack.Push(20);
            stack.Push(30);
            stack.Push(40);
            //stack.PrintStack();
            stack.Peek();
            Console.WriteLine("Item popped from Stack : {0}", stack.Pop());
            //stack.PrintStack();
        }