📅  最后修改于: 2022-03-11 14:46:33.525000             🧑  作者: 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)