📅  最后修改于: 2022-03-11 14:45:39.242000             🧑  作者: Mango
# left to right, pre-order depth first tree search, recursive. O(n) time/space
def depthFirstSearchRec(root):
if root == None: return
print(root)
depthFirstSearch(root.left)
depthFirstSearch(root.right)