mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
travis cli build fail
This commit is contained in:
parent
887f9e5b01
commit
d62e8e2868
@ -6,7 +6,6 @@ import queue
|
||||
|
||||
|
||||
class TreeNode:
|
||||
|
||||
def __init__(self, data):
|
||||
self.data = data
|
||||
self.right = None
|
||||
@ -50,7 +49,6 @@ def pre_order(node):
|
||||
|
||||
def in_order(node):
|
||||
if not isinstance(node, TreeNode) or not node:
|
||||
print("Invalid input")
|
||||
return
|
||||
in_order(node.left)
|
||||
print(node.data, end=" ")
|
||||
@ -59,7 +57,6 @@ def in_order(node):
|
||||
|
||||
def post_order(node):
|
||||
if not isinstance(node, TreeNode) or not node:
|
||||
print("Invalid input")
|
||||
return
|
||||
post_order(node.left)
|
||||
post_order(node.right)
|
||||
@ -68,7 +65,6 @@ def post_order(node):
|
||||
|
||||
def level_order(node):
|
||||
if not isinstance(node, TreeNode) or not node:
|
||||
print("Invalid input")
|
||||
return
|
||||
q = queue.Queue()
|
||||
q.put(node)
|
||||
@ -83,6 +79,7 @@ def level_order(node):
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
|
||||
print("\n********* Binary Tree Traversals ************\n")
|
||||
# For python 2.x and 3.x compatibility: 3.x has not raw_input builtin
|
||||
# otherwise 2.x's input builtin function is too "smart"
|
||||
|
Loading…
Reference in New Issue
Block a user