Please help, I have encounter some problem with this helper file. This seems like a simple one, but somehow I'm not finding the needle after executing "./generate 1000 50 | ./find 127" I have try checking for error in my code like 20 different ways and this took me super long but I still can't find any problem with this code, can someone help?
bool search(int value, int values[], int n)
{
// TODO: implement a searching algorithm
for (int a = 0; n>a; a++)
{
if (values[a] == value)
{
return true;
break;
}
else
{
return false;
}
}
return false;
}
/**
* Sorts array of n values.
*/
void sort(int values[], int n)
{
// TODO: implement an O(n^2) sorting algorithm
return ;
}