Ejemplo n.º 1
0
        public void MinHeap_ExtractRoot_ReturnsMin()
        {
            List<int> testNumbers = GetTestNumbers();
            MinHeap<int> heap = new MinHeap<int>();
            heap.AddRange(testNumbers);
            int expected = testNumbers.Min();

            int min = heap.ExtractRoot();

            Assert.AreEqual(expected, min);
        }