Skip to content

Commit

Permalink
fix: removed bad tests in min_height and max_height in tree keon#758
Browse files Browse the repository at this point in the history
  • Loading branch information
thestar19 committed Mar 3, 2021
1 parent 40f240a commit 587f1df
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
22 changes: 0 additions & 22 deletions algorithms/tree/max_height.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

# iterative

from tree.tree import TreeNode


def max_height(root):
if root is None:
Expand All @@ -32,23 +30,3 @@ def max_height(root):
queue = level
return height


def print_tree(root):
if root is not None:
print(root.val)
print_tree(root.left)
print_tree(root.right)


if __name__ == '__main__':
tree = TreeNode(10)
tree.left = TreeNode(12)
tree.right = TreeNode(15)
tree.left.left = TreeNode(25)
tree.left.left.right = TreeNode(100)
tree.left.right = TreeNode(30)
tree.right.left = TreeNode(36)

height = max_height(tree)
print_tree(tree)
print("height:", height)
22 changes: 0 additions & 22 deletions algorithms/tree/min_height.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tree.tree import TreeNode


def min_depth(self, root):
Expand Down Expand Up @@ -31,24 +30,3 @@ def min_height(root):
new_level.append(node.right)
level = new_level
return height


def print_tree(root):
if root is not None:
print(root.val)
print_tree(root.left)
print_tree(root.right)


if __name__ == '__main__':
tree = TreeNode(10)
tree.left = TreeNode(12)
tree.right = TreeNode(15)
tree.left.left = TreeNode(25)
tree.left.left.right = TreeNode(100)
tree.left.right = TreeNode(30)
tree.right.left = TreeNode(36)

height = min_height(tree)
print_tree(tree)
print("height:", height)

0 comments on commit 587f1df

Please sign in to comment.