[英]Algorithm binary tree makes a path by level of T with complexity O (n)
Hey guys I have a doubt to resolve this issue, someone could help me?嘿伙计们,我有疑问要解决这个问题,有人可以帮助我吗?
A level path in a binary T tree visits all T nodes per level (first level 0 followed by levels 1, 2, 3...) where nodes of the same level are visited from left to right.二叉 T 树中的级别路径访问每个级别的所有 T 节点(第一个级别 0,然后是级别 1、2、3...),其中从左到右访问同一级别的节点。
Write an algorithm that receives as input a binary tree T and makes a path by level of T with complexity O (n), where n is the number of nodes of T.编写一个算法,接收二叉树 T 作为输入,并按 T 的级别创建一条路径,复杂度为 O(n),其中 n 是 T 的节点数。
Using pseudocode:)使用伪代码:)
Hey guys I have a doubt to resolve this issue, someone could help me?嘿伙计们,我有疑问要解决这个问题,有人可以帮助我吗?
A level path in a binary T tree visits all T nodes per level (first level 0 followed by levels 1, 2, 3...) where nodes of the same level are visited from left to right.二叉 T 树中的级别路径访问每个级别的所有 T 节点(第一个级别 0,然后是级别 1、2、3...),其中从左到右访问同一级别的节点。
Write an algorithm that receives as input a binary tree T and makes a path by level of T with complexity O (n), where n is the number of nodes of T.编写一个算法,接收二叉树 T 作为输入,并按 T 的级别创建一条路径,复杂度为 O(n),其中 n 是 T 的节点数。
Using pseudocode:)使用伪代码:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.