コード例 #1
0
        public void EmptyTest()
        {
            var t = BootstrappedHeap <string> .Empty;

            Assert.IsTrue(BootstrappedHeap <string> .IsEmpty(t));

            var t1 = BootstrappedHeap <string> .Insert("C", t);

            Assert.IsFalse(BootstrappedHeap <string> .IsEmpty(t1));
        }
コード例 #2
0
 private static string DumpHeap <T>(BootstrappedHeap <T> .Heap heap) where T : IComparable <T>
 {
     return(BootstrappedHeap <T> .IsEmpty(heap)
         ? "Empty"
         : $"[{heap.X}: {DumpElement(heap.P)}]");
 }