/ / Čo je uzol v strome? - dátové štruktúry, strom, uzly, treenode

Čo je uzol v strome? - dátové štruktúry, stromy, uzly, treenode

Podľa wiki, všetko na strome je uzol.

Terminológie používané v stromoch

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.

Ale potom nájdem nasledujúci obrázok od spoločnosti SAP http://www.sapdesignguild.org/community/design/print_hierarchies2.asp tu zadajte popis obrázku

Takže moja otázka - je správne nazývať koreň, list, rodičov, deti, súrodencov na strome ako uzly?

odpovede:

2 pre odpoveď č. 1

Áno. Koreň je „koreňový uzol.„Rodič je„ rodičovský uzol. “List je„ listový uzol “. Strom pozostáva z uzlov. Pojmy root, rodič, dieťa, súrodenec, list atď. Len popisujú vzťahy medzi uzlami.

Napríklad koreňový uzol nemá rodiča. Uzly lístia nemajú deti. Uzly zdieľania zdieľajú rovnakého rodiča.