Question: Please help in hashtable Data Structures using Java!!! Thanks in advanced! 4. Character Frequencies (20 pts, 11+9) You are given a text file in which
4. Character Frequencies (20 pts, 11+9) You are given a text file in which you are to find how many times each character occurs (frequency). Assume the file consists of T characters in all, with D distinct characters. You may assume that D is much less than T. (For instance, if the file has 1000 characters, and consists ONLY of lowercase letters, then T 1000 and D 26). Note that characters are case sensitive since, when the encoded message is decoded, it should be identical to the original. (SoA' and 'a' are two distinct characters.) Answer the following questions with regard to the running times of the various steps in the encoding process. (a) Suppose a hash table is used to count the number of occurrences of each character (which can then be used to determine probabilities). Derive the worst case AND the expected (assuming uniform distribution of entries over the hash table locations) big O running times to compute the character frequencies. The time needed to read the characters from file into data structures should be counted in your result: assume unit time to read each character from the input file. Your work should be as detailed as possible
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
