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.

Results 1 to 2 of 2

Thread: finding the most repeated name in a stack

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default finding the most repeated name in a stack

    I am new to programming, so please accept my apologies if this question is simple.

    My teacher wants us to create a method that searches a stack for the name that occurs most often and returns it

    for example : If I have these names in my stack:

    Tiger Woods, Jack Nicholas, Arnold Palmer, Jack Nicholas, Jimmy Demerrit, Jack Nicholas, Sam Sneed, Jimmy Demerrit, Ben Hogan, Walter Hagen, Tommy Armor, Bobby Jones

    the method should return Jack Nicholas

    Please help me for I need to know how to do it for my program

    thank you in advance


  2. #2
    Forum VIP
    Join Date
    Jun 2011
    Posts
    317
    My Mood
    Bored
    Thanks
    47
    Thanked 89 Times in 74 Posts
    Blog Entries
    4

    Default Re: finding the most repeated name in a stack

    How would you do this without writing a program? Write it down on paper step by step. This is called pseudo-code and it's your first step towards an answer.

Similar Threads

  1. finding the most repeated name in a stack
    By skoon in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 18th, 2012, 01:26 AM
  2. Replies: 0
    Last Post: July 27th, 2011, 10:31 AM
  3. stack
    By ridg18 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 22nd, 2011, 12:45 PM
  4. Stack
    By AmyH in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 7th, 2010, 04:04 PM
  5. GuessWhat- same errors repeated 4 times?
    By iank in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 5th, 2009, 08:32 PM

Tags for this Thread