Insert the value into the heap. >>> sh = SkewHeap() >>> sh.insert(3) >>> sh.insert(1) >>> sh.insert(3) >>> sh.insert(7) >>> list(sh) [1, 3, 3, 7]
(self, value: T)
| 157 | return iter(result) |
| 158 | |
| 159 | def insert(self, value: T) -> None: |
| 160 | """ |
| 161 | Insert the value into the heap. |
| 162 | |
| 163 | >>> sh = SkewHeap() |
| 164 | >>> sh.insert(3) |
| 165 | >>> sh.insert(1) |
| 166 | >>> sh.insert(3) |
| 167 | >>> sh.insert(7) |
| 168 | >>> list(sh) |
| 169 | [1, 3, 3, 7] |
| 170 | """ |
| 171 | self._root = SkewNode.merge(self._root, SkewNode(value)) |
| 172 | |
| 173 | def pop(self) -> T | None: |
| 174 | """ |