I'm having some trouble figuring out how to keep track of occurrences between two dependent LinkedLists.
Let me elaborate with an example:
These are the linked lists in question.
They are dependent because each value in first list corresponds to the value in the second list with the same index i. Both lists are always the same length.
{sunny, sunny, rainy, sunny, cloudy, sunny, ...}
{yes, no, no, maybe, yes, no, ...}
What I need is to somehow keep track of the "pairs" of occurrences. For example:
sunny -> 1 yes, 1 maybe, 2 no
rainy -> 1 no
cloudy -> 1 yes
Note: There doesn't have to be exactly 3 options. There can be more or less. Also the names of the items of the lists aren't known previously.
So yea, I'm wondering which is the best way to go about storing this information as I've hit a dead end.
Any help is appreciated.