Fixed a bug in the isFound functions where
it would return false negatives
This commit is contained in:
Binary file not shown.
@@ -734,7 +734,7 @@ public class Algorithms{
|
|||||||
//Look through every element in the array, looing for the key element
|
//Look through every element in the array, looing for the key element
|
||||||
for(Integer num : ary){
|
for(Integer num : ary){
|
||||||
//If there is an element in the array that is the same as key return true
|
//If there is an element in the array that is the same as key return true
|
||||||
if(num == key){
|
if(num.equals(key)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -745,7 +745,7 @@ public class Algorithms{
|
|||||||
//Look through every element in the array, looing for the key element
|
//Look through every element in the array, looing for the key element
|
||||||
for(Long num : ary){
|
for(Long num : ary){
|
||||||
//If there is an element in the array that is the same as key return true
|
//If there is an element in the array that is the same as key return true
|
||||||
if(num == key){
|
if(num.equals(key)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -756,7 +756,7 @@ public class Algorithms{
|
|||||||
//Look through every element in the array, looing for the key element
|
//Look through every element in the array, looing for the key element
|
||||||
for(BigInteger num : ary){
|
for(BigInteger num : ary){
|
||||||
//If there is an element in the array that is the same as key return true
|
//If there is an element in the array that is the same as key return true
|
||||||
if(num == key){
|
if(num.equals(key)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user