Questions tagged [linear]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
152 views

pset3: linear search problem

So I was trying to figure out what the code for the linear search function should be and I can't understand where the "false" output should be implemented. The code: bool search(int value, int ...
0
votes
1answer
92 views

"make all" for linear search when changing helpers.c results in "error: control may reach end of non-void function"

Here's the problem. After adding to helpers.c a linear search that will return true if the value is found (per the pset3 spec), I "make all" in the terminal to update helpers.c before testing it, but ...
0
votes
1answer
120 views

Linear Search algorithm

enter code here #include<cs50.h> #include<stdio.h> #include<string.h> int main(int argc, string argv[]); bool search (int value, int values[], int n); { if(argc!= 2) { ...
0
votes
1answer
35 views

pset3: linear search (strange behaviour)

My code is going through check50 okay, but when I try to check it manually it doesn't seem to be able to find the needle in the haystack. I can't figure out why that is happening that's why I'm hoping ...
0
votes
1answer
203 views

Linear Search PSET3 finds and doesn't find

When running check50, I see according to the results that continue to miss some of my loop iterations and can't figure out why. I've moved around the "returns" but still come up with missing "find"s ...