LeetCode 144 Binary Tree Preorder Traversal 题解
1.题目:
Given a binary tree, return the preorder traversal of its nodes’ values.
For example:
Given binary tree {1,#,2,3},
1
\
2
/
3
题意:
输入一个二叉树,输出他的前序遍历节点的值。
2.解题思路:
dp
3.代码
1 |
|
很高兴遇见你~
Given a binary tree, return the preorder traversal of its nodes’ values.
For example:
Given binary tree {1,#,2,3},
1
\
2
/
3
题意:
输入一个二叉树,输出他的前序遍历节点的值。
dp
1 |
|