We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34da76f commit ae755a6Copy full SHA for ae755a6
data_structures/heap/skew_heap.py
@@ -1,14 +1,13 @@
1
-#!/usr/bin/env python3
2
3
from __future__ import annotations
4
5
from collections.abc import Iterable, Iterator
6
-from typing import Any, Generic, TypeVar
+from typing import Any, TypeVar
7
8
-T = TypeVar("T", bound=bool)
+T = TypeVar("T")
9
10
11
-class SkewNode(Generic[T]):
+class SkewNode[T]:
12
"""
13
One node of the skew heap. Contains the value and references to
14
two children.
@@ -86,8 +85,7 @@ def merge(
86
85
87
return result
88
89
-
90
-class SkewHeap(Generic[T]):
+class SkewHeap[T]:
91
92
A data structure that allows inserting a new value and to pop the smallest
93
values. Both operations take O(logN) time where N is the size of the
0 commit comments