an ideal data structure to use herefor we can use words as keys and word counts as values we show such an application in code fragment code fragment program for counting word frequencies in documentprint ing the most frequent word the document is parsed using the scanner classfor which we change the delimiter for separating tokens from whitespace to any non letter we also convert words to lowercase