Skip to content

Commit

Permalink
Renamed the interface functions ToBinaryMaxHeap and ToBinaryMinHeap t…
Browse files Browse the repository at this point in the history
…o ToMaxHeap and ToMinHeap in the IMaxHeap and IMinHeap interfaces
  • Loading branch information
aalhour committed Jun 25, 2015
1 parent 79c3eea commit 2110023
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DataStructures/Heaps/BinaryMaxHeap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public BinaryMaxHeap<T> Union(ref BinaryMaxHeap<T> firstMaxHeap, ref BinaryMaxHe
/// <summary>
/// Returns a new min heap that contains all elements of this heap.
/// </summary>
public IMinHeap<T> ToBinaryMinHeap()
public IMinHeap<T> ToMinHeap()
{
MinBinaryHeap<T> newMinHeap = new MinBinaryHeap<T>(this.Count(), this._heapComparer);
newMinHeap.Heapify(this._collection.ToArray());
Expand Down
2 changes: 1 addition & 1 deletion DataStructures/Heaps/BinaryMinHeap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public MinBinaryHeap<T> Union(ref MinBinaryHeap<T> firstMinHeap, ref MinBinaryHe
/// <summary>
/// Returns a new max heap that contains all elements of this heap.
/// </summary>
public IMaxHeap<T> ToBinaryMaxHeap()
public IMaxHeap<T> ToMaxHeap()
{
BinaryMaxHeap<T> newMaxHeap = new BinaryMaxHeap<T>(this.Count(), this._heapComparer);
newMaxHeap.Heapify(this._collection.ToArray());
Expand Down
2 changes: 1 addition & 1 deletion DataStructures/Heaps/IMaxHeap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ public interface IMaxHeap<T> where T : System.IComparable<T>
/// Returns a new max heap that contains all elements of this heap.
/// </summary>
/// <returns>The max heap.</returns>
IMinHeap<T> ToBinaryMinHeap();
IMinHeap<T> ToMinHeap();
}
}
2 changes: 1 addition & 1 deletion DataStructures/Heaps/IMinHeap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ public interface IMinHeap<T> where T : System.IComparable<T>
/// Returns a new min heap that contains all elements of this heap.
/// </summary>
/// <returns>The min heap.</returns>
IMaxHeap<T> ToBinaryMaxHeap();
IMaxHeap<T> ToMaxHeap();
}
}
2 changes: 1 addition & 1 deletion MainProgram/DataStructuresTests/HeapsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void DoTest ()
Debug.Assert (list.Count == minHeap.Count(), "Wrong size.");

array.HeapSortDescending();
var maxHeap = minHeap.ToBinaryMaxHeap ();
var maxHeap = minHeap.ToMaxHeap ();
Debug.Assert (maxHeap.Peek() == array[0], "Wrong maximum.");
}
}
Expand Down

0 comments on commit 2110023

Please sign in to comment.