(self, key: Callable | None = None)
| 8 | """ |
| 9 | |
| 10 | def __init__(self, key: Callable | None = None) -> None: |
| 11 | # Stores actual heap items. |
| 12 | self.arr: list = [] |
| 13 | # Stores indexes of each item for supporting updates and deletion. |
| 14 | self.pos_map: dict = {} |
| 15 | # Stores current size of heap. |
| 16 | self.size = 0 |
| 17 | # Stores function used to evaluate the score of an item on which basis ordering |
| 18 | # will be done. |
| 19 | self.key = key or (lambda x: x) |
| 20 | |
| 21 | def _parent(self, i: int) -> int | None: |
| 22 | """Returns parent index of given index if exists else None""" |
nothing calls this directly
no outgoing calls
no test coverage detected