mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-22 05:16:39 +08:00
Various ruff fixes (#12821)
This commit is contained in:
@ -7,13 +7,13 @@ from __future__ import annotations
|
||||
|
||||
from itertools import pairwise
|
||||
from random import random
|
||||
from typing import Generic, TypeVar
|
||||
from typing import TypeVar
|
||||
|
||||
KT = TypeVar("KT")
|
||||
VT = TypeVar("VT")
|
||||
|
||||
|
||||
class Node(Generic[KT, VT]):
|
||||
class Node[KT, VT]:
|
||||
def __init__(self, key: KT | str = "root", value: VT | None = None):
|
||||
self.key = key
|
||||
self.value = value
|
||||
@ -49,7 +49,7 @@ class Node(Generic[KT, VT]):
|
||||
return len(self.forward)
|
||||
|
||||
|
||||
class SkipList(Generic[KT, VT]):
|
||||
class SkipList[KT, VT]:
|
||||
def __init__(self, p: float = 0.5, max_level: int = 16):
|
||||
self.head: Node[KT, VT] = Node[KT, VT]()
|
||||
self.level = 0
|
||||
|
Reference in New Issue
Block a user