Esempio n. 1
0
        public void BinaryHeapGetParentTest()
        {
            var        heapData   = GetMaxHeapTestData();
            List <int> parentList = new List <int>();

            for (int i = 0; i < heapData.Length; i++)
            {
                parentList.Add(BinaryHeapBase <int, int> .GetParent(heapData.Length, i));
            }
            CollectionAssert.AreEqual(new int[] { -1, 0, 0, 1, 1, 2, 2 }, parentList);
        }
Esempio n. 2
0
 public void BinaryHeapGetParentGuardCase2Test()
 {
     var heapData = GetMinHeapTestData();
     var result   = BinaryHeapBase <int, int> .GetParent(heapData.Length, 7);
 }