Read until the file is exhausted. For each token, call search... The algorithm encompassing the cases based on the index returned (idx) are If words[idx] matches the new token, increment words[idx]'s counter Otherwise, IF the array isn't at capacity if idx == wordCount New token goes at end else (it will be less that wordCount, no other possibility) Move over existing tokens from wordCount -1 (to wordCount) back to index - This is a function Put new token in the vacated slot, set to 1.