Beispiel #1
0
        public void GenerateArrayDistinctTest()
        {
            int maxValue = 10000;
            int minValue = 1;

            List <int> list = generator.GenerateArray(maxValue);

            Assert.IsTrue(list.Distinct().Count() == list.Count());
            Assert.AreEqual(list.Min(), minValue);
            Assert.AreEqual(list.Max(), maxValue);
        }
Beispiel #2
0
 public static int CountCompareOperations(int arraySize, int maxValue, int key, CommonSearching searching)
 {
     int[] array = ArrayGenerator.GenerateArray(arraySize, maxValue);
     Array.Sort(array);
     searching(array, key);
     return(Searching.Comparings);
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            ArrayGenerator generator  = new ArrayGenerator();
            List <int>     randomList = generator.GenerateArray(10000);

            Out(randomList);
            Console.ReadKey();
        }