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 1e71b72 commit 34da76fCopy full SHA for 34da76f
data_structures/stacks/stack_with_doubly_linked_list.py
@@ -3,19 +3,15 @@
3
4
from __future__ import annotations
5
6
-from typing import Generic, TypeVar
7
8
-T = TypeVar("T")
9
-
10
11
-class Node(Generic[T]):
+class Node[T]:
12
def __init__(self, data: T):
13
self.data = data # Assign data
14
self.next: Node[T] | None = None # Initialize next as null
15
self.prev: Node[T] | None = None # Initialize prev as null
16
17
18
-class Stack(Generic[T]):
+class Stack[T]:
19
"""
20
>>> stack = Stack()
21
>>> stack.is_empty()
0 commit comments