社区
数据结构与算法
帖子详情
微软笔试题-二叉树同级节点链接Link nodes at same level in a binary tree
kernelkoder
2015-03-16 09:01:30
微软笔试题-二叉树同级节点链接Link nodes at same level in a binary tree
请大师指教
...全文
238
1
打赏
收藏
微软笔试题-二叉树同级节点链接Link nodes at same level in a binary tree
微软笔试题-二叉树同级节点链接Link nodes at same level in a binary tree 请大师指教
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
li_x1979
2015-03-17
打赏
举报
回复
广度优先遍历应该就可以了吧。 运行时间是Θ(n),辅助空间可以用队列,内存大小n/2。
Lintcode69
Binary
Tree
Level
Order Traversal solution 题解
【题目描述】 Given a
binary
tree
, return the
level
order traversal of its
nodes
' values. (ie, from left to right,
level
by
level
). 给出一棵
二叉树
,返回其
节点
值的层次遍历(逐层从左往右访问) 【题目
链接
】 www.lintcode.com/en/prob
LeetCode: 102.
Binary
Tree
Level
Order Traversal 按层打印
二叉树
试题 Given a
binary
tree
, return the
level
order traversal of its
nodes
’ values. (ie, from left to right,
level
by
level
). For example: Given
binary
tree
[3,9,20,null,null,15,7], 3 / \ 9 20 ...
102.
Binary
Tree
Level
Order Traversal
题目
Binary
Tree
Level
Order Traversal 层次遍历
二叉树
链接
Given a
binary
tree
, return the
level
order traversal of its
nodes
’ values. (ie, from left to right,
level
by
level
). For example: Given
binary
tr
Binary
Tree
Level
Order Traversal II(层次遍历
二叉树
II)
Given a
binary
tree
, return the bottom-up
level
order traversal of its
nodes
’ values. (ie, from left to right,
level
by
level
from leaf to root).(给定一个
二叉树
,返回其自底向上层次遍历序列的
节点
值)For example: Given
binary
tr
《中英双解》leetCode
Binary
Tree
Level
Order Traversal(
二叉树
的层序遍历)
Given the root of a
binary
tree
, return the
level
order traversal of its
nodes
' values. (i.e., from left to right,
level
by
level
). 给你一个
二叉树
,请你返回其按层序遍历得到的
节点
值。 (即逐层地,从左到右访问所有
节点
)。 示例:
二叉树
:[3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 ...
数据结构与算法
32,945
社区成员
35,339
社区内容
发帖
与我相关
我的任务
数据结构与算法
数据结构与算法相关内容讨论专区
复制链接
扫一扫
分享
社区描述
数据结构与算法相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章