All Questions
4 questions
0
votes
1
answer
38
views
find problem with my code - CPU overload
I cannot figure out what is wrong with my code.
/**
* Returns true if value is in array of n values, else false.
*/
bool search(int value, int values[], int n)
{
// ensures that the n is non ...
0
votes
1
answer
72
views
pset3: sort and search work in separate files, but my helpers.c doesn't work
I dealt with sorting in a separate file first, and then I dealt with searching in another file. They seem to work okay or at least worked for the numbers I feed in, but when I put them in helpers and ...
0
votes
2
answers
161
views
Segmentation Fault pset3 for Find
I'm getting a segmentation fault error and I can't figure out why.
void sort(int values[], int n)
{
// TODO: implement a sorting algorithm
for (int i = 0; i<n; i++)
{
if ((n!=i+...
0
votes
1
answer
95
views
Pset3 Find - Not sure what is wrong with helpers.c code
I am not sure what is wrong with the code. It seems to work on some of the criteria when using cs50's check50, but does not work on others. There also does not seem to have a pattern about the wrong ...