dwj100uni
10-25-2005, 07:30 PM
Hi there, having a bit of trouble on a project I am working on.
Basically I need to read in a set of ASCii characters (could be any of 256) from a file and keep a total of each, i.e. 2 A's, 7 B's 8 C's, etc.
I thought that a double linked list was what i needed, however after research i can see that that is only really used for to allow movement forewards and backwards between nodes, and i am not sure how i could get an array list to hold two values (i.e. the character it represents and the no of occurances), however, i could use one as i know the max number would be 256.
If anyone could shed anylight on this it would be greatly appreciated,
Thanks
David
Basically I need to read in a set of ASCii characters (could be any of 256) from a file and keep a total of each, i.e. 2 A's, 7 B's 8 C's, etc.
I thought that a double linked list was what i needed, however after research i can see that that is only really used for to allow movement forewards and backwards between nodes, and i am not sure how i could get an array list to hold two values (i.e. the character it represents and the no of occurances), however, i could use one as i know the max number would be 256.
If anyone could shed anylight on this it would be greatly appreciated,
Thanks
David