Skip to content
Open
Changes from all commits
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
4 changes: 4 additions & 0 deletions searches/binary_tree_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def __init__(self, data):


def build_tree() -> TreeNode:
"""
Builds a binary tree by receiving input and returns the root node of the tree.
Stops and returns the tree once 'N' is entered.
"""
print("\n********Press N to stop entering at any point of time********\n")
check = input("Enter the value of the root node: ").strip().lower()
q: queue.Queue = queue.Queue()
Expand Down