Reputation:
Any best algorithm or any brute force method to implement the following things?
Cheers,
Venki
Upvotes: 0
Views: 941
Reputation: 962
Use understandable and maintainable code unless you have special need for performance issues for this task
You could try something like this :
the StringTokenizer separates your input line into "words" . you then iterate through them and implement your logic (count, search etc.)
int count =0;
StringTokenizer st = new StringTokenizer(input);
while (st.hasMoreTokens()) {
addWordsInCapsToList();
findSpecificWords();
count ++;
}
Upvotes: 0