Esempio n. 1
0
        static void Main(string[] args)
        {
            //Stack stack = new Stack(3);
            //stack.push("Ali");
            //stack.push("Ali 2");
            //stack.push("Ali 1");
            //stack.push("Ali 5");

            //stack.push("Hamce");
            //stack.push("Usman");

            //Console.WriteLine("The Stack Contain the Following.");

            //while(!stack.isEmpty())
            //{
            //    string mo = stack.Pop();
            //    Console.WriteLine(mo);
            //}


            //Console.ReadKey();

            //QuerClASS querClASS = new QuerClASS(3);

            //querClASS.inQue(112);

            //querClASS.inQue(122);
            //querClASS.inQue(212);
            //querClASS.inQue(22);

            //querClASS.view();

            ////Built in Stack

            //DemoStack();


            BuiltInQueue.Demo();

            Console.ReadKey();


            int[]  arry   = { 1, 3, 4, 6, 7, 8, 345, 2 };
            int    re     = 4;
            Class1 class1 = new Class1();

            int res = Class1.LenearSearch(arry, re);

            Console.WriteLine("The Lenear Search Number is  {0}", res);
            Console.ReadKey();

            Class1.BuiltIn();
        }
            public void EnqueueTest()
            {
                Queue queue = new BuiltInQueue();

                queue.Enqueue(5);
                queue.Enqueue(7);
                queue.Enqueue(9);

                var outputQueue = getQueueBuiltIn(queue);

                Assert.AreEqual(3, outputQueue.Count);
                Assert.AreEqual(5, outputQueue.Dequeue());
                Assert.AreEqual(7, outputQueue.Dequeue());
                Assert.AreEqual(9, outputQueue.Dequeue());
            }