Skip to content

Commit ea76220

Browse files
committed
refactor
1 parent 5a8631b commit ea76220

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Advanced.Algorithms/DataStructures/Heap/BHeap.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public BHeap(SortDirection sortDirection, IEnumerable<T> initial, IComparer<T> c
5555
i++;
5656
}
5757

58-
BulkInit(initArray);
58+
bulkInit(initArray);
5959
Count = initArray.Length;
6060
}
6161
else
@@ -64,7 +64,7 @@ public BHeap(SortDirection sortDirection, IEnumerable<T> initial, IComparer<T> c
6464
}
6565
}
6666

67-
private void BulkInit(T[] initial)
67+
private void bulkInit(T[] initial)
6868
{
6969
var i = (initial.Length - 1) / 2;
7070

@@ -86,7 +86,8 @@ private void bulkInitRecursive(int i, T[] initial)
8686
var left = 2 * i + 1;
8787
var right = 2 * i + 2;
8888

89-
var minMax = left < initial.Length && right < initial.Length ? comparer.Compare(initial[left], initial[right]) < 0 ? left : right
89+
var minMax = left < initial.Length && right < initial.Length ?
90+
comparer.Compare(initial[left], initial[right]) < 0 ? left : right
9091
: left < initial.Length ? left
9192
: right < initial.Length ? right : -1;
9293

src/Advanced.Algorithms/DataStructures/Heap/d-aryHeap.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public DaryHeap(int k, SortDirection sortDirection = SortDirection.Ascending, IE
4747
}
4848

4949
Count = initArray.Length;
50-
BulkInit(initArray);
50+
bulkInit(initArray);
5151

5252
}
5353
else
@@ -60,7 +60,7 @@ public DaryHeap(int k, SortDirection sortDirection = SortDirection.Ascending, IE
6060
/// Initialize with given input.
6161
/// Time complexity: O(n).
6262
/// </summary>
63-
private void BulkInit(T[] initial)
63+
private void bulkInit(T[] initial)
6464
{
6565
var i = (initial.Length - 1) / k;
6666

0 commit comments

Comments
 (0)