• Post Reply Bookmark Topic Watch Topic
  • New Topic

WordCount Exercises updateLetterCount() Method  RSS feed

 
Chan Duller
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to fill in the code for the updateLetterCount() method, which should be quite similar to the updateDigramCount() method.
However, I am stuck. Any suggestions would be helpful! I am having trouble with defining the letter variable,
because I know it has to be defined for the Map. Any idea about how to go about doing so?



 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the algorithm you are using for counting letters?
 
Chan Duller
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is shown in the getLetterCount() method.
 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That seems a standard method to do it; you will find something very similar in the Java™ Tutorials.
Why are you using a tree map? Why are you missing out the last character?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!