You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe your implementation of Word Count Engine may have some errors. With an input string like "z y x o n m d c b a", your solution does not always maintain the relative order in which words with the same occurrence. While Collections.sort does guarantee a stable sort, iterating over the keys in a HashMap is not guaranteed to give you keys in insertion order, and in fact no guarantee is made on the order of key retrieval here.
The text was updated successfully, but these errors were encountered:
I believe your implementation of Word Count Engine may have some errors. With an input string like "z y x o n m d c b a", your solution does not always maintain the relative order in which words with the same occurrence. While
Collections.sort
does guarantee a stable sort, iterating over the keys in a HashMap is not guaranteed to give you keys in insertion order, and in fact no guarantee is made on the order of key retrieval here.The text was updated successfully, but these errors were encountered: