fvasco / jug-2017-07

6 stars 4 forks source link

Add "vanilla" Java 8 version #3

Closed tarilabs closed 7 years ago

tarilabs commented 7 years ago

Proposal for a "vanilla" Java 8 version.

fvasco commented 7 years ago

Hi @tarilabs, nice occurrences implementation, I think that is more clear than the current OccurrenceCountInMap.

I just published the "rules", implementing sorting algorithm is required.

I suggest you to modify current java8 release dropping the OccurrenceCountInMap class in favour your solution, really more representative of Java way.

For the next meeting it is preferable choose only one solution for a given language/version, so merging the current implementations would be nice.

tarilabs commented 7 years ago

As mentioned on the original conversation (email) sorting is pointless in this case; so I've added as step3 "for fairness" only as a forced guarantee when iterating back the occurrences entries by key in their natural ordering with the default JDK implementation which is more representative. The comment is representative of this.

gicappa commented 7 years ago

@tarilabs 👍 like it!