Fixed a bug in the isFound functions where

it would return false negatives
This commit is contained in:
2019-07-29 00:14:45 -04:00
parent 8fe685f7e0
commit 891eeffaf2
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@@ -734,7 +734,7 @@ public class Algorithms{
//Look through every element in the array, looing for the key element
for(Integer num : ary){
//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;
}
}
@@ -745,7 +745,7 @@ public class Algorithms{
//Look through every element in the array, looing for the key element
for(Long num : ary){
//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;
}
}
@@ -756,7 +756,7 @@ public class Algorithms{
//Look through every element in the array, looing for the key element
for(BigInteger num : ary){
//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;
}
}