diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-01-21 09:50:37 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-01-21 09:50:37 +0100 |
commit | 4176b9b53df47c2351b38695c3d899680403bed2 (patch) | |
tree | 503a1318d449280da53e1fcac8bc3f059e8813ce /src/algorithms/searching/HybridBinarySearch.java | |
parent | add interpolation search (diff) | |
download | algorithms-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.java | 4 |
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++; |