Leetcode Tree Summary

  Binary Tree   Traversal: preorder, inorder, post order   recursion template:   def traversal(root): # none or leaf if not root: # do sth # divide left = traversal(root.left) right = traversal(root.right) # Conquer res = # merge return res   iterative template:   Details see: https://www.jianshu.com/p/456af5480cee   preorder example: postorder   Recursion Type: … Continue reading Leetcode Tree Summary