Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to store a frequency table?

807603Nov 26 2007 — edited Nov 26 2007
Hi there i am doing some frequency analysis on a passage of text which is basically counting up all of the occurances of the characters (a-z)

I need to be able to store something like:

E = 40
A = 35
T = 32
I =28
O =21
.....

I can semi achieve this using a Hashmap - but i need to be able to store this as structure that can be ordered by value not just key... i dont want A,B,C,D etc

The purpose of this is i am going to end up with 2 structures of which one contains english alphabet and the other contains a ciphertext freq chart - and then match the letters.... based on the freq.

Any ideas??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2007
Added on Nov 26 2007
12 comments
186 views