可以以非二叉树tranversed? [英] Can a non binary tree be tranversed in order?
问题描述
我们正在处理在这里最相似neigthbour算法。该算法的一部分涉及搜索,以便在一棵树。
We are dealing with a Most similar neigthbour algorithm here. Part of the algorithm involves searching in order over a tree.
的事情是,到现在为止,我们不能让这棵树是二进制的。
The thing is that until now, we cant make that tree to be binary.
有没有在序遍历的非二进制树模。具体地讲,我认为有,只是遍历节点从左至右(以及处理所述父节点只有一次?)
Is there an analog to in order traversal for non binary trees. Particularly, I think there is, just traversing the nodes from left to right (and processing the parent node only once?")
有什么想法?
这棵树将在每个节点n对象的一个小图。每个节点将有n个儿童(1%在图中的每个元件),其每一个将是另一个曲线图。因此,其种AB树,没有所有的溢出 - 溢机制。所以我想最相似的序遍历将类似于B树序遍历?
This tree will have in each node a small graph of n objects. Each node will have n children (1 per each element in the graph), each of which will be another graph. So its "kind of" a b tree, without all the overflow - underflow mechanics. So I guess the most similar in order traversal would be similar to a btree inorder traversal ?
在此先感谢。
推荐答案
是的,但你需要定义的顺序是什么。邮政和pre顺序是相同的,但序需要的分支与节点如何比较的定义。
Yes, but you need to define what the order is. Post and Pre order are identical, but inorder takes a definition of how the branches compare with the nodes.
这篇关于可以以非二叉树tranversed?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!