What is this tree of objects?

I need to create a tree built from nodes that can have any number (within reason, between 0 and 10 words) of outgoing transitions, for example:

               X 
             / | \
            X  X  X
           /
          X
         / \
        X   X

What tree structure is this? What are the methods for creating and, in particular, modifying trees of this kind?

thank

+3
source share
5 answers

It is just a common tree. Perhaps because binary trees are so common, this tree looks different, but in fact it is a binary tree, which is a special case of the tree.

. , , , . , , 0 10 , / 10 .

+4

, . ( 2 node). .

+4

2-3 , 2 3 , .

+1

. , , , 2 0, .

, , : , .

(, , ), node , node -to-child, node. ,

0, 0, 1

node. , ​​ node.

+1

You have a simple tree. Special cases are binary trees or a balanced tree. This is not true.

Most languages ​​have libraries for managing them. Recursion is a popular technique. All college-level textbooks on data structures talk in detail about how to draw a tree.

You can get a review here .

+1
source

Source: https://habr.com/ru/post/1752889/


All Articles