Exemplo n.º 1
0
        public void TestNonEmptyHeap(int[] nums, int minValue)
        {
            BaseHeap heap = HeapHelper.CreateMinHeap(nums);

            Assert.False(heap.IsEmpty);
            Assert.True(heap.IsFull);
            Assert.True(heap.IsHeap());
            Assert.Equal(minValue, heap.GetRoot());
            Assert.Equal(minValue, heap.PopRoot());
        }
Exemplo n.º 2
0
        public Graph(IEnumerable <INode> graph, BaseHeap <INode> pq)
        {
            if (graph == null)
            {
                throw new ArgumentNullException("Graph");
            }

            if (pq == null)
            {
                throw new ArgumentNullException("Priority Queue");
            }

            this.graph = graph;
            this.pq    = pq;
        }
Exemplo n.º 3
0
 public MockedGraph(IEnumerable <INode> graph, BaseHeap <INode> pq)
     : base(graph, pq)
 {
 }