bool search(int value, int values[], int n)
// TODO: implement a searching algorithm
if (n >= 0)
{
for (int i = 0; i < n; i++)
{
if (values[i] == value)
return true;
}
}
return false;
Very confused.
1. When I make the program, do I "make helpers" or "make find"? Or does it even matter for this part, because I'll be typing ./generate 1000 50 | ./find 127?
2. Why do a linear search inside a bool search? What is a bool search? What's the difference between it an a linear search?
3. The short on this sucks - their code uses colons, and doesn't include semicolons in the right spots (I think).
4. Does it matter if I type "true" or "TRUE"?
5. Why is this code not working when I type ./generate 1000 50 | ./find 127?