MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

data_structures/heap/skew_heap.py:114–123  ·  view source on GitHub ↗

>>> sh = SkewHeap([3, 1, 3, 7]) >>> list(sh) [1, 3, 3, 7]

(self, data: Iterable[T] | None = ())

Source from the content-addressed store, hash-verified

112 """
113
114 def __init__(self, data: Iterable[T] | None = ()) -> None:
115 """
116 >>> sh = SkewHeap([3, 1, 3, 7])
117 >>> list(sh)
118 [1, 3, 3, 7]
119 """
120 self._root: SkewNode[T] | None = None
121 if data:
122 for item in data:
123 self.insert(item)
124
125 def __bool__(self) -> bool:
126 """

Callers

nothing calls this directly

Calls 1

insertMethod · 0.95

Tested by

no test coverage detected