From e33d860c0a62f1b0feafc3796cd49c685a9a2842 Mon Sep 17 00:00:00 2001 From: Diwas Dahal <105503443+di-was@users.noreply.github.com> Date: Mon, 24 Jul 2023 16:28:10 +0545 Subject: [PATCH] Update basic_binary_tree.py --- .../binary_tree/basic_binary_tree.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/data_structures/binary_tree/basic_binary_tree.py b/data_structures/binary_tree/basic_binary_tree.py index 0d3c85335..7dcbf3d69 100644 --- a/data_structures/binary_tree/basic_binary_tree.py +++ b/data_structures/binary_tree/basic_binary_tree.py @@ -12,22 +12,7 @@ class Node: self.right: Node | None = None -def display(tree: Node | None) -> None: # In Order traversal of the tree - """ - >>> root = Node(1) - >>> root.left = Node(0) - >>> root.right = Node(2) - >>> display(root) - 0 - 1 - 2 - >>> display(root.right) - 2 - """ - if tree: - display(tree.left) - print(tree.data) - display(tree.right) + def display_using_in_order_traversal(root: Node | None, level: int = 0) -> None: