push
- MinHeap.push(data, priority)
Add data object.
Re-adding an already queued object will update the queued object’s priority instead of adding a duplicate with a different priority, see
update()
.- Parameters:
- Raises:
TypeError – If data is not derived from a hashable data type.
Note
Only hashable objects can be added to a heap. All user defined types are hashable.