/// <summary> /// HeapHelper ctor. /// </summary> /// <param name="capacity">Capacity of heap.</param> /// <param name="heapPropertyComparer">Heap property comparer for T.</param> internal protected HeapHelper(int capacity, IHeapPropertyComparer <T> heapPropertyComparer) { capacity.ThrowIfArgumentOutOfRange(nameof(capacity)); heapPropertyComparer.ThrowIfArgumentNull(nameof(heapPropertyComparer)); this.capacity = capacity; this.heapPropertyComparer = heapPropertyComparer; this.heap = new T[capacity]; }
/// <summary> /// HeapBase. /// </summary> /// <param name="capacity">Capacity of heap.</param> /// <param name="heapPropertyComparer">Heap property comparer for T.</param> public HeapBase(int capacity, IHeapPropertyComparer <T> heapPropertyComparer) { heapHelper = new HeapHelper <T>(capacity, heapPropertyComparer); }