when a value in it changes?
See, read about heap data structure. Its insertion and deletion is O(log(n)), where n is the number of elements. That means a heap can give you the minimum (a min-heap) or maximum (max-heap) in logarithmic time complexity.
Yes.
Обсуждают сегодня