Exemple #1
0
        public void HeapPriorityQueue()
        {
            var pq = new HeapPriorityQueue <int>(11);

            SetupPriorityQueue(pq, 10, 100, 10);

            int outIndex = 0;
            var output   = new int[10];

            while (!pq.IsEmpty())
            {
                output[outIndex++] = pq.DelMax();
            }
            Assert.AreEqual(new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, output);
        }