Example #1
0
        static void Main(string[] args)
        {
            Queue queue = new Queue();

            queue.Enqueue(56);
            queue.Enqueue(30);
            queue.Enqueue(70);
            queue.Display();
            queue.dequeue();
            queue.Display();
        }
Example #2
0
        static void Main(string[] args)
        {
            //Stack Operations
            Stack <float> stack = new Stack <float>();

            stack.Push(1.2f);
            stack.Push(32f);
            stack.Push(44.3f);
            stack.Display();

            //Queue Operations
            Queue <string> queue = new Queue <string>();

            queue.Enqueue("Hello");
            queue.Enqueue("There");
            queue.Enqueue("How");
            queue.Display();
        }
        static void Main(string[] args)
        {
            //Stack Operations
            Stack stack = new Stack();

            stack.Push(70);
            stack.Push(30);
            stack.Push(56);
            stack.Display();
            stack.Peek();
            stack.Pop();
            stack.IsEmpty();
            stack.Display();

            //Queue Operations
            Queue linkedListQueue = new Queue();

            linkedListQueue.Enqueue(56);
            linkedListQueue.Enqueue(30);
            linkedListQueue.Enqueue(70);
            linkedListQueue.Dequeue();
            linkedListQueue.Display();
        }