CopyPastor

Detecting plagiarism made easy.

Score: 0.8658030826134743; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2021-12-21
by Abdul Momen

Original Post

Original - Posted on 2010-08-11
by Steve B.



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Smells like homework, but a few suggestions -
- there's no reason for your Hashmap to be of the form `<String,Object>` - make it `<String, String[][]>` , as that's what you're storing.
You're iterating twice. You either - iterate through the map, either the keys, values or entries. Each item is an iterator return value, e.g.
for (String[][] s:map.values()){ ... }

- hashmap.values.toArray gives you all of the contents, which is the same thing your iterator is doing.
- if you're only iterating through the contents, then you're not really using a map, as you're never making use of the fact that your values are available by key.
Smells like homework, but a few suggestions -
- there's no reason for your Hashmap to be of the form `<String,Object>` - make it `<String, String[][]>` , as that's what you're storing.
You're iterating twice. You either - iterate through the map, either the keys, values or entries. Each item is an iterator return value, e.g.
for (String[][] s:map.values()){ ... }
- hashmap.values.toArray gives you all of the contents, which is the same thing your iterator is doing.
- if you're only iterating through the contents, then you're not really using a map, as you're never making use of the fact that your values are available by key.


        
Present in both answers; Present only in the new answer; Present only in the old answer;