Esempio n. 1
0
        static void Main(string[] args)
        {
            var stack = new MyStack <string>();

            stack.Push("ivane");
            Console.WriteLine(stack.Peek());
            Console.WriteLine(stack.Pop());

            stack.Push("Sralo");
            stack.Push("me4e");
            stack.Push("na");
            stack.Push("pute4e");
            Console.WriteLine(stack.Count);
            Console.WriteLine(stack.Pop());
            Console.WriteLine(stack.Count);
        }
Esempio n. 2
0
        public static void Main()
        {
            var stack = new MyStack <int>();

            stack.Push(12);
            stack.Push(50);
            Console.WriteLine("Pop: " + stack.Pop());

            stack.Push(-115);
            stack.Push(65);
            stack.Push(22);
            Console.WriteLine("Peek: " + stack.Peek());

            stack.Push(512);
            stack.Push(602);
            stack.Push(16);
            Console.WriteLine("Pop: " + stack.Pop());

            Console.WriteLine(string.Join(" -> ", stack));
        }