Fix result printing
parent
b652cffba4
commit
3794906b0b
|
@ -69,7 +69,7 @@ int main(int argc, char** argv){
|
||||||
|
|
||||||
std::cout << "Finding " << val << "..."<<std::endl;
|
std::cout << "Finding " << val << "..."<<std::endl;
|
||||||
int pos = splitted_array_search(split_array, 0, n-1, val, n);
|
int pos = splitted_array_search(split_array, 0, n-1, val, n);
|
||||||
if (val >=0)
|
if (pos >=0)
|
||||||
std::cout << val << " is at index " << pos << std::endl;
|
std::cout << val << " is at index " << pos << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << "Value not found" << std::endl;
|
std::cout << "Value not found" << std::endl;
|
||||||
|
|
|
@ -72,7 +72,7 @@ int main(int argc, char** argv){
|
||||||
usleep(1000000);
|
usleep(1000000);
|
||||||
int pos = splitted_array_search(split_array, 0, n-1, val, n);
|
int pos = splitted_array_search(split_array, 0, n-1, val, n);
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
if (val >=0)
|
if (pos >=0)
|
||||||
std::cout << val << " is at index " << pos << std::endl;
|
std::cout << val << " is at index " << pos << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << "Value not found" << std::endl;
|
std::cout << "Value not found" << std::endl;
|
||||||
|
|
Loading…
Reference in New Issue