[LeetCode]94, 144, 145 Binary Tree InOrder, PreOrder, PostOrder Traversal_Medium

Given a binary tree, return the inorder, preorder, postorder traversal of its nodes' values.

Example:

Input: [1,null,2,3]
   1
    \
     2
    /
   3

inorder Output: [1,3,2]
preorder Output: [1,2,3]
postorder Output: [3,2,1]

这三个题目的思路及总结都在LeetCode questions conlusion_InOrder, PreOrder, PostOrder traversal里面.

猜你喜欢

转载自www.cnblogs.com/Johnsonxiong/p/9348509.html