I cant think of a reason to use it.
Type: Posts; User: dark3stnit3s
I cant think of a reason to use it.
No i must have misunderstood you
1 would beat all of them
followed by 2
the position from the left determines their place
the first from the left is the first place winner for each voter
7 would only beat 8
it is important to a degree because I am trying to find the winner...but as i said before there is a possibility of no winner
I don't know if I quite understand your last statement but to clarify in a row with 3 columns, the first number is the first place position and it beast the last two, the middle is 2nd place and the...
The algorithm currently being used is that the first candidate is compared to every candidate in the list. Then the second is compared to everyone in the list and so on to determine what position the...
the 3 3 equates to the number of voters and number of candidates
the 1st row is how the first voter would rank the candidates - ie. 0 1 2 (0 would win followed by 1 and last 2).
each row is a...
right now, I think it compares the first candidate to every other candidate. Then it moves to the second and compares... But what I think will be the fastest if it could store the positions of the...
here is the whole output... There are a total of 25 "elections"
Winner of election 1 is candidate 1
TimeExec: Election 1: 0.0050s
No winner for election 2
TimeExec: Election 2: 0.0010s
No...
I know that the search cannot be linear. I think I just need to compare the winner like if 0 beats 1 then don't compare 2 to 1 compare 2 to zero because if two beats zero it will also have more...
here is some of the output I get when I run but after this it takes about an hour to get the next result due to the vastness of infile and the poor algorithm.
Winner of election 1 is candidate 1...
here is the missing class:
import java.io.OutputStream;
import java.io.PrintStream;
/**
*
* A utility class used to time the execution of a Runnable
*/
here is a bit of the infile:
3 3
0 1 2
1 0 2
2 1 0
3 3
0 1 2
1 2 0
2 0 1
4 5
the infile is just a sequence that equates to an "election". Basically I just need any kind of tips on how to reduce the amount of for loops in order to speed this program up because as of right now...
I was given a program in one of my 300 level college classes. It supposed to calculate winners of voters voting on candidates in a specific order. The assignment is to look at the code and try to get...