Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

stl set vs min_heap

Правка en1, от dumbguy, 2017-10-17 15:15:17

Suppose i only need to get the minimum element at every instance (there is constant addition and removal of items).
Which would be optimum in terms of time complexity? stl set or min_heap (implemented as priority_queue)
I know min_heap gets the minimum element in O(1). But what about stl set? Is it O(1) or more than O(1).
Thanks

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский dumbguy 2017-10-17 15:15:17 365 Initial revision (published)