Exemplo n.º 1
0
        public void BinaryHeapGetRightChildTest()
        {
            var        heapData  = GetMaxHeapTestData();
            List <int> childList = new List <int>();

            for (int i = 0; i < heapData.Length; i++)
            {
                childList.Add(BinaryHeapBase <int, int> .GetRightChild(heapData.Length, i));
            }
            CollectionAssert.AreEqual(new int[] { 2, 4, 6, -1, -1, -1, -1 }, childList);
        }
Exemplo n.º 2
0
 public void BinaryHeapGetRightChildGuardCase2Test()
 {
     var heapData = GetMaxHeapTestData();
     var result   = BinaryHeapBase <int, int> .GetRightChild(heapData.Length, 7);
 }