Clear the heap. >>> rh = RandomizedHeap([3, 1, 3, 7]) >>> rh.clear() >>> rh.pop() Traceback (most recent call last): ... IndexError: Can't get top element for the empty heap.
(self)
| 173 | return self._root.value |
| 174 | |
| 175 | def clear(self) -> None: |
| 176 | """ |
| 177 | Clear the heap. |
| 178 | |
| 179 | >>> rh = RandomizedHeap([3, 1, 3, 7]) |
| 180 | >>> rh.clear() |
| 181 | >>> rh.pop() |
| 182 | Traceback (most recent call last): |
| 183 | ... |
| 184 | IndexError: Can't get top element for the empty heap. |
| 185 | """ |
| 186 | self._root = None |
| 187 | |
| 188 | def to_sorted_list(self) -> list[Any]: |
| 189 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected