Java's priority queue is a data structure with O(log n) complexity for put (insertion) and O(log n) for ...
stackoverflow.com