Skip to content

doubly linked list: add dataclass and typing #12647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
LinkedList is a dataclass
  • Loading branch information
isidroas committed Mar 31, 2025
commit 2d0e2a4b97062704514ca7a7c3309d1b94dd75dd
6 changes: 3 additions & 3 deletions data_structures/linked_list/doubly_linked_list_two.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def __next__(self):
return value


@dataclass
class LinkedList:
def __init__(self):
self.head = None # First node in list
self.tail = None # Last node in list
head: Node | None = None
tail: Node | None = None

def __str__(self):
current = self.head
Expand Down