Exemplo n.º 1
0
        public void Test1()
        {
            var list = new List <int> {
                5, 8, 4, 1, 2, 6, 4, 7, 9, 2
            };

            HeapSorter.HeapSort <int>(list, null);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="collection">A list</param>
 /// <param name="comparer">A comparer</param>
 public BinarySearcher(IList <T> collection, Comparer <T> comparer)
 {
     if (collection == null)
     {
         throw new NullReferenceException("List is null");
     }
     _collection = collection;
     _comparer   = comparer;
     HeapSorter.HeapSort(_collection);
 }
Exemplo n.º 3
0
        public void HeapSorter_Duplicates_Test()
        {
            int[] unsortedInts = { 6, 12, 8, 2, 9, 6 };

            HeapSorter.HeapSort(unsortedInts);
        }
Exemplo n.º 4
0
        public void HeapSorter_Sort_Check_Sorting_Behavior()
        {
            int[] unsortedInts = { 6, 12, 8, 2, 9 };

            HeapSorter.HeapSort(unsortedInts);
        }