• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java map problem  RSS feed

 
al barzino
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code below return the least frequent AGE or rarest age in the name/age map below;
{Alyssa=22, Char=25, Dan=25, Jeff=20, Kasey=20, Kim=20, Mogran=25, Ryan=25, Stef=22}

which is stef=22 as it shows up twice where others show up 3 times. I cannot understand the code starting at line 11 on. I'd appreciate any help.
 
R. Jain
Ranch Hand
Posts: 375
1
Java Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
al barzino wrote:



Actually this block of code is trying to find minimum value out of every key's value in the map.. (You know the simplest code to find minimum out of n numbers, you can understand this code.. )
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
al barzino wrote:The code below...

Al, when posting code, please UseCodeTags (←click). And please read the page carefully, because there are a few gotchas to know about.
I'd suggest that you also correct the indentation (use the Edit key); it'll make it a lot easier to read.

Winston

[Edit] Oh, and welcome to JavaRanch.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!