Abstract— Priority queues are essential for various network processing applications, including per-flow queueing with Quality-of-Service (QoS) guarantees, management of large fa...
We give an O(n lg n)-time algorithm for counting the number of inversions in a permutation on n elements. This improves a long-standing previous bound of O(n lg n/ lg lg n) that ...