コード例 #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);
        }
コード例 #2
0
 public void BinaryHeapGetRightChildGuardCase2Test()
 {
     var heapData = GetMaxHeapTestData();
     var result   = BinaryHeapBase <int, int> .GetRightChild(heapData.Length, 7);
 }