HashMap doesn’t preserve any order by default. If order is required we need to sort it explicitly according to the requirement.
In this article I have tried to explain how to sort a HasMap based on values.
HashMap doesn’t preserve any order by default. If order is required we need to sort it explicitly according to the requirement.
In this article I have tried to explain how to sort a HasMap based on values.
Linked List
A linked list is a dynamic data structure. The number of nodes in a list is not fixed and can grow and shrink on demand. Any application which has to deal with an unknown number of objects will need to use a linked list.
Continue reading How to Implement Singly Linked List in Java