I know this answer isn't in strict Java, it's in pseudo C++, but that dosnt matter, its the theory in it that counts.
I would've made the linked list of some class of some sort ie:
Code:
class my_item{
int count;
string name;
my_item * next;
my_item *prev;
public: my_item(string n){name=n; count=1;};
public: void increment(){count++;};
};
Then when I read a word from the input, see if it's in the list, if it is increment the counter at the appropriate point, else add it to the list.
Once done reading, just sort the linked list according to counter size.