Skip to main content
2 votes
Accepted

Pset3 Music random interger stored

That's because you're trying to store the character at the 1st index of a char array (string), node, into an int variable directly, without converting it into an int first. So the 5 in your example is ...
ziayanj's user avatar
  • 81
2 votes
Accepted

pset3 frequency "called object type 'int' is not a function or function pointer" (line 108)

I can't tell if actualIncrease3 is a function or an integer variable. It is declared inside of the frequency() function as an integer by this: int actualIncrease3; Later, in lines 108 to 122, it ...
Cliff B's user avatar
  • 69k
2 votes
Accepted

pset3 bubble sort

My sincere recommendation is ... start again. You have two nested loops, each time the DO-WHILE loop begins, the min and max values are set to zero, as the end-of-cycle condition for while is values[...
MARS's user avatar
  • 5,179
2 votes

Practicing my source code

Your main() doesn't have a body, and so the use of printf() is considered a separate declaration of a new function, which also doesn't have a body. The fact that the body is missing is because you ...
ChrisG's user avatar
  • 7,396
2 votes
Accepted

pset3 - Binary search not finding the element in middle

In testing, the code works fine. Is it possible that you have a problem with your sort function? Have you verified that sort is correct by printing out the sorted list with different test data? As a ...
Cliff B's user avatar
  • 69k
1 vote
Accepted

Pset 3: What's wrong with my binary search code?

OK, first your sort() is definitely wrong. By saying values[i]=values[j], doesn't mean that those two values are exchanged, so now both values[i] and values[j] have the value that values[j] had. ...
ChrisG's user avatar
  • 7,396
1 vote
Accepted

Pset 3 - Timing out issue with helper.c

Victory! I figured out the problem and I don't really know why it fixed it. I moved the declaration of int end and int start to just above the while clause. I left the declaration of int middle inside ...
Clayton Ingalls's user avatar
1 vote

Pset 3 - Timing out issue with helper.c

It seems that your search program has an infinite loop, it is almost always the fault of the end condition while loop, make sure that the loop breaks at some point, I suspect the program will work if ...
MARS's user avatar
  • 5,179
1 vote

CS50 > Pset3 > Game of fifteen > init function :

If they are not swapped, the puzzle is not solvable. You can review the Wikipedia article about the game to learn about the arcane mathematics "happening behind the screen".
DinoCoderSaurus's user avatar
1 vote
Accepted

Pset3 - Problem with Bubble Sort

In your swap part, you assign to values[j] twice, second should be values[j+1]
Blauelf's user avatar
  • 21k
1 vote
Accepted

pset3 buble sort() function works but it gives wrong output in helper.c

You have two problems with the last element, or the one just behind the array. In code for(i = 0; i < n && no_swap == false; i++) { no_swap = true; for(j = 0; j < ...
Blauelf's user avatar
  • 21k

Only top scored, non community-wiki answers of a minimum length are eligible