elementsWithPriority
All elements with their priorities ordered by the time of adding (elements added earlier go first) Complexity: O(n log(n))
All elements with their priorities ordered by the time of adding (elements added earlier go first) Complexity: O(n log(n))