public void InitStack()
        {
            StackUsingLinkedList stck = new StackUsingLinkedList();
            for (int i = 1; i <= 5; i++)
            {
                stck.Push(i * 10);
            }

            stck.Display();
            Console.WriteLine("Top elemnts in the stack is " + stck.peek());

            for (int i = 1; i <= 3; i++)
            {
                var element = stck.Pop();
            }

            stck.Display();

            for (int i = 1; i <= 3; i++)
            {
                var element = stck.Pop();
            }

            Console.ReadKey();
        }
Beispiel #2
0
        public void InitStack()
        {
            StackUsingLinkedList stck = new StackUsingLinkedList();

            for (int i = 1; i <= 5; i++)
            {
                stck.Push(i * 10);
            }

            stck.Display();
            Console.WriteLine("Top elemnts in the stack is " + stck.peek());

            for (int i = 1; i <= 3; i++)
            {
                var element = stck.Pop();
            }

            stck.Display();


            for (int i = 1; i <= 3; i++)
            {
                var element = stck.Pop();
            }

            Console.ReadKey();
        }