From 1ce58efe1fdd747b53f1104db1a6a1700684ff17 Mon Sep 17 00:00:00 2001 From: Francisco Matias Date: Wed, 21 Jun 2017 00:44:26 -0300 Subject: [PATCH] With example --- .../Binary Tree/binary_seach_tree.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/data_structures/Binary Tree/binary_seach_tree.py b/data_structures/Binary Tree/binary_seach_tree.py index 81532ee22..b6aac2990 100644 --- a/data_structures/Binary Tree/binary_seach_tree.py +++ b/data_structures/Binary Tree/binary_seach_tree.py @@ -75,3 +75,27 @@ class BinarySearchTree: def getRoot(self): return self.root + +''' +Example + 8 + / \ + 3 10 + / \ \ + 1 6 14 + / \ / + 4 7 13 +''' + +t = BinarySearchTree() +t.insert(8) +t.insert(3) +t.insert(1) +t.insert(6) +t.insert(4) +t.insert(7) +t.insert(10) +t.insert(14) +t.insert(13) + +t.preShow(t.getRoot())