コード例 #1
0
        public void InsertTest()
        {
            var empty = BootstrappedHeap <string> .Empty;
            var heap  = BootstrappedHeap <string> .Insert("A", empty);

            Assert.AreEqual("A", BootstrappedHeap <string> .FindMin(heap));
        }
コード例 #2
0
        public void DeleteMinTest()
        {
            var ts1 = "c a b".Split().Aggregate(BootstrappedHeap <string> .Empty, (current, word) => BootstrappedHeap <string> .Insert(word, current));
            var ts2 = BootstrappedHeap <string> .DeleteMin(ts1);

            Assert.AreEqual("b", BootstrappedHeap <string> .FindMin(ts2));
        }
コード例 #3
0
 public void FindEmptyMinTest()
 {
     AssertThrows <ArgumentNullException>(() => BootstrappedHeap <string> .FindMin(BootstrappedHeap <string> .Empty));
 }