小编Jon*_*cki的帖子

二叉树的级别顺序遍历

我想执行二叉树的级别顺序遍历.因此,对于给定的树,请说:

     3
    / \
   2   1
  / \   \
 4   6   10
Run Code Online (Sandbox Code Playgroud)

输出将是:

3 2 1 4 6 10
Run Code Online (Sandbox Code Playgroud)

我知道我可以使用某种队列,但是在C中递归执行此算法的算法是什么?任何帮助赞赏.

c algorithm binary-tree

3
推荐指数
1
解决办法
9287
查看次数

标签 统计

algorithm ×1

binary-tree ×1

c ×1