• Post Reply Bookmark Topic Watch Topic
  • New Topic

Iterating through a Map  RSS feed

 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to perform some averaging functions within a program using a Map and I found myself going back to the array for some steps. I don't want to do this, I would like to have the collection handle these tasks but need some pointers. THanks!
 
Kyle Redding
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you asking? Think about switching average to a running sum. If you want to use a map again then make average a map that stores integers. That might not be very helpful. Clarify what you want to do.
 
nithin chinni
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code will be small if you start using collections.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!