/ / Qu'est-ce qu'un nœud dans un arbre? - structures de données, arborescence, nœuds, treenode

Quel est le noeud dans un arbre? - structures de données, arborescence, nœuds, treenode

Selon wiki, tout dans un arbre est un noeud.

Terminologies utilisées dans les arbres

Root – The top node in a tree.
Parent – The converse notion of child.
Siblings – Nodes with the same parent.
Descendant – a node reachable by repeated proceeding from parent to child.
Ancestor – a node reachable by repeated proceeding from child to parent.
Leaf – a node with no children.
Internal node – a node with at least one child.
External node – a node with no children.
Degree – number of sub trees of a node.
Edge – connection between one node to another.
Path – a sequence of nodes and edges connecting a node with a descendant.
Level – The level of a node is defined by 1 + the number of connections between the node and the root.
Height of tree –The height of a tree is the number of edges on the longest downward path between the root and a leaf.
Height of node –The height of a node is the number of edges on the longest downward path between that node and a leaf.
Depth –The depth of a node is the number of edges from the node to the tree"s root node.
Forest – A forest is a set of n ≥ 0 disjoint trees.

Mais alors je trouve l'image suivante de SAP http://www.sapdesignguild.org/community/design/print_hierarchies2.asp entrer la description de l'image ici

Alors ma question - est-il juste d'appeler comme nœuds racine, feuille, parents, enfants, frères et sœurs?

Réponses:

2 pour la réponse № 1

Oui. La racine est "le nœud racine."Un parent est un" nœud parent ". Une feuille est un" nœud feuille. "L'arborescence est composée de nœuds. Les termes racine, parent, enfant, frère, feuille, etc. décrivent simplement les relations entre les nœuds.

Par exemple, le nœud racine n'a pas de parent. Les nœuds foliaires n'ont pas d'enfants. Les nœuds frères partagent le même parent.