• Post Reply Bookmark Topic Watch Topic
  • New Topic

Collections - patter matching program  RSS feed

 
Ramakrishna Gummadi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends

I done program for pattern matching. The program is we need to store words in memory like stand, stone, state and Red, road, Ramp. Now if a user gives first character of the word then it should print the words which starts with that letter.
Example :- User enter character S
Then output should be
stand
stone
state.

So this program i done using List.

I want to know that can we do using Map? how ?

Thanks in advance friends...
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That might require sorting. Have you tried a SortedSet?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!