mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Remove file-level flake8 suppression (#7844)
* Remove file-level flake8 suppression * updating DIRECTORY.md * Fix tests Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
# flake8: noqa
|
||||
|
||||
"""
|
||||
This is pure Python implementation of tree traversal algorithms
|
||||
"""
|
||||
@ -157,16 +155,16 @@ def level_order_actual(node: TreeNode) -> None:
|
||||
q: queue.Queue = queue.Queue()
|
||||
q.put(node)
|
||||
while not q.empty():
|
||||
list = []
|
||||
list_ = []
|
||||
while not q.empty():
|
||||
node_dequeued = q.get()
|
||||
print(node_dequeued.data, end=",")
|
||||
if node_dequeued.left:
|
||||
list.append(node_dequeued.left)
|
||||
list_.append(node_dequeued.left)
|
||||
if node_dequeued.right:
|
||||
list.append(node_dequeued.right)
|
||||
list_.append(node_dequeued.right)
|
||||
print()
|
||||
for node in list:
|
||||
for node in list_:
|
||||
q.put(node)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user