From efcc523e78925b2cdd71759cca37c9e504ebc377 Mon Sep 17 00:00:00 2001 From: santhoshtk Date: Fri, 13 Jan 2023 18:24:51 +0530 Subject: [PATCH] Resolve --flake-- issues --- algorithms/Python/trees/binaryTreeTraversals.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/algorithms/Python/trees/binaryTreeTraversals.py b/algorithms/Python/trees/binaryTreeTraversals.py index c5560b40..0a6639c1 100644 --- a/algorithms/Python/trees/binaryTreeTraversals.py +++ b/algorithms/Python/trees/binaryTreeTraversals.py @@ -31,7 +31,7 @@ class BinaryTree: def __init__(self): self.root = None - def insert(self, value: int) -> str: + def insert(self, data: int) -> str: """ Create a `BinaryTreeNode` with the `value` and insert the node at the vacant place in the Binary Tree. @@ -39,11 +39,11 @@ class BinaryTree: NOTE : The vacant place can be found using level order traversal. Also, we need queue for level order traversal. - :param value: The value of the `BinaryTreeNode`. + :param data: The value of the `BinaryTreeNode`. :return: A meaningful message to the user of the program. """ if not self.root: - self.root = BinaryTreeNode(value) + self.root = BinaryTreeNode(data) else: # Creating the FIFO (Queue) for level order traversal auxQueue: Queue = Queue() @@ -54,13 +54,13 @@ class BinaryTree: # Check if current node has vacant place. if currentNode.leftChild is None: - currentNode.leftChild = BinaryTreeNode(value) + currentNode.leftChild = BinaryTreeNode(data) break else: auxQueue.put(currentNode.leftChild) if currentNode.rightChild is None: - currentNode.rightChild = BinaryTreeNode(value) + currentNode.rightChild = BinaryTreeNode(data) break else: auxQueue.put(currentNode.rightChild) @@ -155,7 +155,7 @@ class IterativeTraversal(BinaryTree): return "The Binary Tree is Empty." else: auxStack: list = [] - previous: BinaryTreeNode + previous = BinaryTreeNode currentNode = self.root while currentNode or auxStack: