Exemplo n.º 1
0
        public void UnsortedListTest()
        {
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();
            UnsortedList<int> l1 = new UnsortedList<int>();
            for (int i = 0; i < numberOfInsertedElements; i++)
            {
                l1.Add(o[i]);
            }
            stopWatch.Stop();
            Console.WriteLine("Inserting into Unsorted List time: {0}", stopWatch.Elapsed);

            stopWatch.Start();
            for (int i = 0; i < numberOfDeletedElements; i++)
            {
                l1.ReturnMin();
            }

            l1.Add(o[numberOfInsertedElements]);
            stopWatch.Stop();
            Console.WriteLine("Deleting from Unsorted List and inserting 1 elemento time: {0}", stopWatch.Elapsed);
        }