Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 2 of 2 FirstFirst 12
Results 26 to 32 of 32

Thread: Program Optimization

  1. #26
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Program Optimization

    1 2 3 4 5 6 7 8
    Then is this correct:
    7 beats 1 other cand.
    6 beats 2 other cand.
    5 beats 3 other cand.
    4 beats 4 other cand.
    3 beats 5 other cand.
    2 beats 6 other cand.
    1 beats 7 other candidates
    Last edited by Norm; September 29th, 2012 at 04:28 PM.
    If you don't understand my answer, don't ignore it, ask a question.

  2. #27
    Junior Member
    Join Date
    Sep 2012
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Program Optimization

    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

  3. #28
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Program Optimization

    So the count of the number of candidates that are beaten is not important?
    The fact that candidate 1 has beaten 7 other candidates is not useful.
    If you don't understand my answer, don't ignore it, ask a question.

  4. #29
    Junior Member
    Join Date
    Sep 2012
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Program Optimization

    I cant think of a reason to use it.

  5. #30
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Program Optimization

    Is it important which candidate is beaten?

    I don't understand the rules.
    You said:
    1 is the winner because he beats 0 twice and 2 twice.

    Is it important who is beaten?
    If you don't understand my answer, don't ignore it, ask a question.

  6. #31
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Program Optimization

    so your votes in your file:
    0 1 2
    1 0 2
    2 1 0
    would fill a table like the following:

    Voters In Order | 1stVote | 2ndVote | 3rdVote
    First Voter's Card | cand.0 | cand.1 | cand.2
    2nd Voter's Card | cand.1 | cand.0 | cand.2
    3rd Voter's Card | cand.2 | cand.1 | cand.0

    ?

  7. #32
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Program Optimization

    It looks like you're suppose to implement something similar to Instant runoff voting. However, I can't tell how you're handling tie-breakers.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Circular prime checking algorithm optimization.
    By aesguitar in forum Algorithms & Recursion
    Replies: 5
    Last Post: July 26th, 2012, 11:35 AM
  2. Recursive Fibonacci sequence optimization
    By aesguitar in forum Algorithms & Recursion
    Replies: 2
    Last Post: June 24th, 2012, 08:49 AM
  3. Java Quick Sort Optimization
    By javaNewb37 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 4th, 2011, 07:32 AM
  4. A Star Pathfinding algorithm optimization
    By randomcracker in forum Algorithms & Recursion
    Replies: 4
    Last Post: May 18th, 2011, 11:11 PM
  5. Swing app gui optimization
    By nik_meback in forum AWT / Java Swing
    Replies: 1
    Last Post: December 6th, 2010, 12:55 PM