/// <summary> /// Returns a new max heap that contains all elements of this heap. /// </summary> public IMaxHeap <T> ToMaxHeap() { BinaryMaxHeap <T> newMaxHeap = new BinaryMaxHeap <T>(this.Count, this._heapComparer); newMaxHeap.Initialize(this._collection.ToArray()); return(newMaxHeap); }