Example #1
0
        public void MaxPQ_InputStringArray_ConstructHeap()
        {
            string[]       s  = { "S", "O", "R", "T", "E", "X", "A", "M", "P", "L", "E" };
            MaxPQ <string> pq = new MaxPQ <string>(s);

            Assert.AreEqual(pq.max(), "X");
        }
Example #2
0
        public void MaxPQ_InputStringArray_DelMaxSink()
        {
            string[]       s  = { "S", "O", "R", "T", "E", "X", "A", "M", "P", "L", "E" };
            MaxPQ <string> pq = new MaxPQ <string>(s);

            pq.delMax();
            Assert.AreEqual(pq.max(), "T");
        }