(11-11-2012, 06:25 AM)AnyOldName3 Wrote: Now, back vaguely towards actual programming:in high level languages, hashmaps typically work such that you have pairs of values, called a "key", and a "value". The key is used as if it is an index into the hashmap.
Can someone who knows some java help me with something. For a program I'm working on I need a method which puts the frequency of each character in the alphabet as a separate entry into an array (or as parts of the internet have suggested when I googled it, a hashmap, which I don't have a clue how to use). The program overall will put this data into a .csv file with a user specified name (which I've already got working). Basically, I have no idea what functions will help me, so can't even write a psuedocode version. When I looked it up, I found some examples, but don't like using other people's code unless I know what each line does and why, which is why I'm asking for help: I'd like to be told generally what I'll need to do, and which functions I'll need, and why, then try and make it myself from that information.
Consider a normal array where you might do something like this:
Code:
alphabet[0] == "a"Code:
alphabet_indices["a"] == 0you can use this to easily do something like:
Code:
for character in input_string:
hitcounts[character] = hitcounts[character] + 1note i'm not using java, but you should get the idea.
