My logic is fine, but my hashmap is not printing values in ascending order according to keys instead it is displaying according to value.
output should be
4 2 1 3
and my output is : 1 2 3 4
My logic is fine, but my hashmap is not printing values in ascending order according to keys instead it is displaying according to value.
output should be
4 2 1 3
and my output is : 1 2 3 4