This is my first experience in writing code using HashMap
and HashSet
and I am a little confused where to start from. I want to read a file and count the number of strings used but I have to do this using HashMap
and HashSet
.
Any ideas on where to start from?
So I will read the file and put the strings in an array and then read it from the array and putting them into a HashSet
? Is this an idiotic idea?
The constraint is that The only O(n)
operation in the program should be iterating through the text file.
Thank you for the contribution in increasing my knowledge ;)