Example #1
0
        public IndexMinPQ <string> initIndexMinPQ()
        {
            var pq = new IndexMinPQ <string>(9);

            pq.insert(1, "P");
            pq.insert(2, "Q");
            pq.insert(3, "E");
            pq.insert(4, "X");
            pq.insert(5, "A");
            pq.insert(6, "M");
            pq.insert(7, "P");
            pq.insert(8, "L");
            pq.insert(9, "E");

            return(pq);
        }
Example #2
0
        public void INdexMinPQ_insertResize_NoException()
        {
            var pq = new IndexMinPQ <string>(2);

            System.IndexOutOfRangeException exception = null;
            try
            {
                pq.insert(1, "P");
                pq.insert(2, "Q");
                pq.insert(3, "E");
            }
            catch (System.IndexOutOfRangeException e)
            {
                exception = e;
            }

            Assert.AreEqual(null, exception);
        }