Esempio n. 1
0
        private static void ArrangeSHop(QueueTasks queueTasks)
        {
            DateTime date1 = new DateTime(2021, 11, 2);
            DateTime date2 = new DateTime(2020, 11, 3);

            queueTasks.ArrangeShop(new DateTime(2020, 01, 02));
        }
Esempio n. 2
0
        private static void MergeSuperQueues(QueueTasks queueTasks)
        {
            MyQueue <string> closedQ = new MyQueue <string>();

            closedQ.Insert("closed1");
            closedQ.Insert("closed2");
            closedQ.Insert("closed3");
            closedQ.Insert("closed4");
            closedQ.Insert("closed5");
            closedQ.Insert("closed6");
            closedQ.Insert("closed7");
            closedQ.Insert("closed8");
            closedQ.Insert("closed9");
            closedQ.Insert("closed10");
            closedQ.Insert("closed11");
            closedQ.Insert("closed12");

            MyQueue <string> openQ = new MyQueue <string>();

            openQ.Insert("open1");
            openQ.Insert("open2");
            openQ.Insert("open3");
            openQ.Insert("open4");
            openQ.Insert("open5");
            openQ.Insert("open6");
            openQ.Insert("open7");
            openQ.Insert("open8");
            openQ.Insert("open9");



            queueTasks.MergeSupermarketQueues(closedQ, openQ);
            Console.WriteLine(openQ.ToString());
        }
Esempio n. 3
0
        private static void ReverseQueue(QueueTasks queueTasks)
        {
            MyQueue <int> queue = new MyQueue <int>();

            queue.Insert(1);
            queue.Insert(2);
            queue.Insert(3);
            queue.Insert(4);

            MyQueue <int> Revqueue = queueTasks.ReverseQueue(queue);
        }
Esempio n. 4
0
        private static void Carriers(QueueTasks queueTasks)
        {
            MyQueue <Carrier> carriers = new MyQueue <Carrier>();

            carriers.Insert(new Carrier("1", 3));
            carriers.Insert(new Carrier("2", 4));
            carriers.Insert(new Carrier("3", 8));
            carriers.Insert(new Carrier("4", 16));
            carriers.Insert(new Carrier("5", 15));
            carriers.Insert(new Carrier("6", 17));
            carriers.Insert(new Carrier("7", 14));

            Console.WriteLine(queueTasks.SendCarrier(14, carriers));
            Console.WriteLine("");
        }
Esempio n. 5
0
        private static void Jobs(QueueTasks queueTasks)
        {
            MyQueue <Job> jobs = new MyQueue <Job>();

            jobs.Insert(new Job("1", 3));
            jobs.Insert(new Job("2", 3));
            jobs.Insert(new Job("3", 4));
            jobs.Insert(new Job("4", 3));
            jobs.Insert(new Job("5", 1));
            jobs.Insert(new Job("6", 17));
            jobs.Insert(new Job("7", 2));
            jobs.Insert(new Job("8", 10));


            queueTasks.DequeueJobsThatCanBeDone(14, jobs);
        }
Esempio n. 6
0
        private static void GetMiddleQueue(QueueTasks queueTasks)
        {
            MyQueue <int> queue = new MyQueue <int>();

            queue.Insert(2);
            queue.Insert(5);
            queue.Insert(6);
            queue.Insert(9);
            queue.Insert(1);
            queue.Insert(3);

            MyQueue <int> middleQueue = queueTasks.GetMiddleQueue(3, queue);

            Console.WriteLine(queue.ToString());
            Console.WriteLine(middleQueue.ToString());
        }
Esempio n. 7
0
        private static void MergeSortedQueues(QueueTasks queueTasks)
        {
            MyQueue <int> q1 = new MyQueue <int>();
            MyQueue <int> q2 = new MyQueue <int>();

            q1.Insert(1);
            q1.Insert(3);
            q1.Insert(8);


            q2.Insert(1);
            q2.Insert(4);
            q2.Insert(5);
            q2.Insert(6);
            q2.Insert(7);
            MyQueue <int> queue = queueTasks.MergeSortedQueues(q2, q1);
        }
Esempio n. 8
0
        private static void GetPairQueue(QueueTasks queueTasks)
        {
            MyQueue <int> queue = new MyQueue <int>();

            queue.Insert(2);
            queue.Insert(4);
            queue.Insert(1);
            queue.Insert(5);
            queue.Insert(7);
            queue.Insert(8);
            queue.Insert(9);
            queue.Insert(1);
            queue.Insert(5);
            queue.Insert(2);

            MyQueue <int> pairQueue = queueTasks.GetPairQueue(queue);

            Console.WriteLine(pairQueue.ToString());
        }
Esempio n. 9
0
        static void Main(string[] args)
        {
            RecursionTasks  recursion       = new RecursionTasks();
            QueueTasks      queueTasks      = new QueueTasks();
            AdditionalTasks additionalTasks = new AdditionalTasks();

            MyQueue <Trip>   trips    = new MyQueue <Trip>();
            MyQueue <Family> familyQ1 = new MyQueue <Family>();

            familyQ1.Insert(new Family("1", "shiran", 1));
            familyQ1.Insert(new Family("1", "miki", 2));
            familyQ1.Insert(new Family("1", "lili", 2));
            familyQ1.Insert(new Family("1", "zizi", 6));
            trips.Insert(new Trip("Tel aviv", "1", new DateTime(2020, 3, 5), 100, familyQ1));

            MyQueue <Family> familyQ2 = new MyQueue <Family>();

            familyQ2.Insert(new Family("2", "shiran", 4));
            familyQ2.Insert(new Family("2", "miki", 2));
            familyQ2.Insert(new Family("2", "lili", 3));
            familyQ2.Insert(new Family("2", "zizi", 5));
            trips.Insert(new Trip("Jerusalem", "2", new DateTime(2020, 3, 3), 80, familyQ2));

            Console.WriteLine(queueTasks.OperateDriveAndHike(new DateTime(2020, 3, 4), new DateTime(2020, 4, 4), "2", trips));

            //OperateSuperMarket();
            //GetGreatestCharFromSeperation(additionalTasks);
            //GetEqualDistancePairs(additionalTasks);
            //Console.WriteLine(Trouble(2,6));
            //TestTrackingTableQueue();
            //DisplayAsTable(recursion);
            //recursion.PrintAllEvenDigits(123456789);
            //MergeSuperQueues(queueTasks);
            //ArrangeSHop(queueTasks);
            //GetMiddleQueue(queueTasks);
            //GetPairQueue(queueTasks);
            //ReverseQueue(queueTasks);
            //MergeSortedQueues(queueTasks);
            //Jobs(queueTasks);
            //Carriers(queueTasks);
        }