Fix mypy errors in circular_linked_list.py and swap_nodes.py (#9707)

* updating DIRECTORY.md

* Fix mypy errors in circular_linked_list.py

* Fix mypy errors in swap_nodes.py

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Tianyi Zheng
2023-10-04 12:05:00 -04:00
committed by GitHub
parent 3fd3497f15
commit dfdd78135d
3 changed files with 19 additions and 12 deletions

View File

@ -11,7 +11,7 @@ class Node:
"""
self.data = data
self.next = None # Reference to the next node
self.next: Node | None = None # Reference to the next node
class LinkedList:
@ -19,7 +19,7 @@ class LinkedList:
"""
Initialize an empty Linked List.
"""
self.head = None # Reference to the head (first node)
self.head: Node | None = None # Reference to the head (first node)
def print_list(self):
"""