Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 28562
0 votes
Accepted

Trouble with find_min

First, there's no guarantee that candidates[0] isn't eliminated. You'd have to go through the candidates array and find the first one that isn't eliminated. Also, you're messing up the candidates arra …
Llenk's user avatar
  • 744
0 votes

check50 errors - runoff

tabulate: What if the voter's top candidate is eliminated? Your code will never check their next preference, but it needs to do that. find_min: it looks like you're trying to sort the candidates arra …
Llenk's user avatar
  • 744
1 vote

pset3 print_winner (prints name when someone has a majority)

check50 is seeing if you print the candidate's name, then a newline. You're printing the candidate's name, then a space, then a newline. The formatting is pretty finicky, so you'll need to remove the …
Llenk's user avatar
  • 744
1 vote
Accepted

Pset3 Runoff tabulation issues

rank++ This means "tell me the value of rank, then add one to rank". So in the last line of elim_test, you're calling elim_test again with the exact same values over and over again. To fix this, you c …
Llenk's user avatar
  • 744
0 votes

Pset3 runoff tabulation error

If I'm understanding what you're doing correctly, the first chunk of code is somewhere in eliminate. What you're doing may well work correctly in the full program, but check50 doesn't test your full p …
Llenk's user avatar
  • 744
0 votes

Help with pset3 runoff

A couple things: argv[] isn't available globally, so you're probably not able to compile your program because you're using it in this method. You should use the candidates array instead, since that is …
Llenk's user avatar
  • 744