Using the Lower Bound on Sorting
Claim: I have a PQ
Insert time: O(1)
GetMax time: O(1)
True or false?
False (for general sets)
because if such a PQ
existed, it could be used to
sort in time O(n)
True for items in a small range
(Note: such a set can be sorted
in O(n) time)
Claim: I have a PQ
Insert time: O(loglog n)
GetMax time: O(loglog n)
True or false?
False (for general sets)
because it could be used to
sort in time O(n loglog n)
True for items with priorities in
range 1..n [van Emde Boas]
(Note: such a set can be sorted
in O(n) time)
CS409 - Spring 2000
4