Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner scan = new Scanner(inputStream);
- String word, sortedWord;
- HashMap<String, ArrayList<String>> words = new HashMap<String, ArrayList<String>>();
- while ((word = scan.next()) != null) {
- sortedWord = sortWord(word);
- if (words.get(sortedWord) != null) {
- ArrayList<String> tmp = words.get(sortedWord);
- if (tmp == null) {
- tmp = new ArrayList<String>();
- }
- tmp.add(word);
- words.put(sortedWord, tmp);
- } else {
- ArrayList<String> tmp = new ArrayList<String>();
- tmp.add(word);
- words.put(sortedWord, tmp);
- }
- }
- System.out.println("iteratori start");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement