hi,
Goal: to find count of all words in a file. file contains 1000+ words
My approach: use a HashMap() to store and count the number of times each word appears in the file.
Question: Would a HashMap() be the best way or would it be better to use a Binary Tree for ensuring faster lookup as there is a large count of words in the file?
Or is there a better way to do this?
HashMap would result in a lot of memory overhead which is not desired.
Thanks