【leetcode_easy】589. N-ary Tree Preorder Traversal

problem

589. N-ary Tree Preorder Traversal

N叉树的前序遍历

首先复习一下树的4种遍历,前序、中序、后序和层序。其中,前序、中序和后序是根据根节点的顺序进行区分和命名的。

层序遍历,即是按树的层从上到下、从左到右进行遍历。

参考

1. Leetcode_easy_589. N-ary Tree Preorder Traversal;

2. Grandyang;

猜你喜欢

转载自www.cnblogs.com/happyamyhope/p/11049716.html
今日推荐