summaryrefslogtreecommitdiff
path: root/Assets/Algorithms/Searching/SearchingHelper.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-06-22 22:54:20 +0800
committerchai <chaifix@163.com>2021-06-22 22:54:20 +0800
commit75f032d79023fcf40dc8a52ebb2b3dc190aad609 (patch)
tree9e03067ef42dceb3f90e3988f6e027bc035b7429 /Assets/Algorithms/Searching/SearchingHelper.cs
parent8938c3447d88e31f77f20553ed185fc8e64c9ac8 (diff)
*divide
Diffstat (limited to 'Assets/Algorithms/Searching/SearchingHelper.cs')
-rw-r--r--Assets/Algorithms/Searching/SearchingHelper.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Assets/Algorithms/Searching/SearchingHelper.cs b/Assets/Algorithms/Searching/SearchingHelper.cs
index 1605b43..a36e653 100644
--- a/Assets/Algorithms/Searching/SearchingHelper.cs
+++ b/Assets/Algorithms/Searching/SearchingHelper.cs
@@ -31,25 +31,25 @@ namespace AlgorithmCollection.Searching
return -1; // 没找到
}
- public static int BinarySearch<T>(List<T> dataList, T value) where T : IComparable, IEquatable<T>
+ public static int BinarySearch<T>(List<T> data, T value) where T : IComparable, IEquatable<T>
{
int index = -1;
- RecursionHelper.DivideAndConquer(dataList,
- (IList<T> data) =>
+ RecursionHelper.DivideAndConquer(
+ () =>
{
DivisionDescriptor div = new DivisionDescriptor();
div.left = 0;
div.right = data.Count - 1;
return div;
},
- (IList<T> data, DivisionDescriptor div) =>
+ (DivisionDescriptor div) =>
{
if (data[div.left].CompareTo(value) == 0)
{
index = div.left;
}
},
- (IList<T> data, DivisionDescriptor div, out bool bAdhoc) =>
+ (DivisionDescriptor div, out bool bAdhoc) =>
{
int left = div.left;
int right = div.right;