aboutsummaryrefslogtreecommitdiffstats
path: root/src/algorithms/searching/HybridBinarySearch.java
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-01-21 09:50:37 +0100
committerMattias Andrée <maandree@operamail.com>2014-01-21 09:50:37 +0100
commit4176b9b53df47c2351b38695c3d899680403bed2 (patch)
tree503a1318d449280da53e1fcac8bc3f059e8813ce /src/algorithms/searching/HybridBinarySearch.java
parentadd interpolation search (diff)
downloadalgorithms-and-data-structures-4176b9b53df47c2351b38695c3d899680403bed2.tar.gz
algorithms-and-data-structures-4176b9b53df47c2351b38695c3d899680403bed2.tar.bz2
algorithms-and-data-structures-4176b9b53df47c2351b38695c3d899680403bed2.tar.xz
m + add hybrid interpolation search
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/algorithms/searching/HybridBinarySearch.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/algorithms/searching/HybridBinarySearch.java b/src/algorithms/searching/HybridBinarySearch.java
index bb0739c..6590313 100644
--- a/src/algorithms/searching/HybridBinarySearch.java
+++ b/src/algorithms/searching/HybridBinarySearch.java
@@ -159,7 +159,7 @@ public class HybridBinarySearch
*/
private static £(fun "int" linearFirst "${T} item, ${T}[] array, int start, int end")
{
- /* This is nearly identical to LinearSearch.indexOfFirst */
+ /* This is nearly identical to LinearSearch.indexOfFirst */
int i = start < 0 ? (array.length - start) : start;
int n = end < 0 ? (array.length - end) : end;
@@ -169,7 +169,7 @@ public class HybridBinarySearch
if (i == n)
break;
- if (array[i] == item)
+ if (£(equal array[i] item))
return i;
i++;