Ejemplo n.º 1
0
        public void DeletingElem_EmptyArray_Test()
        {
            Beap b = new Beap();

            b.Delete(5);

            Assert.AreEqual(0, b.HeapSize);
        }
Ejemplo n.º 2
0
        public void DeletingElem_ForBranches_Test(int a, int q, int c, int d)
        {
            Beap b = new Beap();

            b.Insert(10);
            b.Insert(15);
            b.Insert(14);
            b.Insert(25);
            b.Insert(13);
            b.Insert(19);
            b.Insert(20);
            b.Insert(50);
            b.Insert(22);

            b.Delete(a);
            b.Delete(q);
            b.Delete(c);
            b.Delete(d);

            Assert.AreEqual(5, b.HeapSize);
        }
Ejemplo n.º 3
0
        public void DeletingElem_LowerRow_Test(int a)
        {
            Beap b = new Beap();

            b.Insert(0);
            b.Insert(-1);
            b.Insert(1);
            b.Insert(2);

            b.Delete(a);

            Assert.AreEqual(3, b.HeapSize);
        }
Ejemplo n.º 4
0
        public void DeletingElem_FullArray_Test(int toDelete)
        {
            Beap b = new Beap();

            b.Insert(8);
            b.Insert(4);
            b.Insert(10);
            b.Insert(2);
            b.Insert(7);

            b.Delete(toDelete);

            Assert.AreEqual(4, b.HeapSize);
        }
Ejemplo n.º 5
0
        public void DeletingElem_ForHeightDecrease_Test(int a)
        {
            Beap b = new Beap();

            b.Insert(10);
            b.Insert(15);
            b.Insert(14);
            b.Insert(25);
            b.Insert(13);
            b.Insert(19);
            b.Insert(20);

            b.Delete(a);

            Assert.AreEqual(6, b.HeapSize);
        }