Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            SampleStack <string> stack = new SampleStack <string>();

            stack.Push("hello1");
            stack.Push("hello2");
            stack.Push("hello3");
            stack.Push("hello4");
            Console.Write(stack.Top());
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            SampleStack <int> obj = new SampleStack <int>();

            obj.Push(new Node <int>(1));

            obj.Push(new Node <int>(2));
            obj.Pop();
            obj.Push(new Node <int>(3));
            obj.Push(new Node <int>(4));
            obj.Push(new Node <int>(5));
            obj.Pop();

            obj.PrintStack();

            Console.ReadLine();
        }