A combinatorial Gray code for a set of combinatorial objects is a sequence of all combinatorial objects in the set so that each object is derived from the preceding object by changing a small part. In this paper we design a Gray code for ordered trees with n vertices such that each ordered tree is derived from the preceding ordered tree by removing a leaf then appending a leaf elsewhere. Thus the change is just remove-and-append a leaf, which is the minimum.
翻译:一组组合对象的组合灰色代码是集中所有组合对象的序列,这样每个对象通过修改一个小部分而从上一个对象中产生。 在本文件中,我们为带有n 脊椎的定序树设计了一个灰色代码,这样每棵定购的树就从前面的定序树中产生,取出一片叶子,然后在别处附着一片叶子。 因此更改只是移除和附加叶子,这是最起码的。