Since both std::priority_queue
and std::set
(and std::multiset
) are data containers that store elements and allow you to access them in an
std::priority_queue
allows to do the following:
O(log n)
O(1)
O(log n)
while std::set
has more possibilities:
O(log n)
and the constant is greater than in std::priority_queue
O(log n)
O(log n)
(lower_bound
)O(log n)
iterator
O(1)
O(1)
O(1)
O(1)