Difference between revisions of "Tree"

From Computer History Wiki
Jump to: navigation, search
(An OK start)
 
(Define 'acyclic')
 
Line 1: Line 1:
A '''tree''' is a way of structuring a collection of data. It starts with a '''root'''' element, which has to be found by some external (to the data collection) means. From there on, each element contains [[pointer]]s to one or more '''children''', each of which similarly has one or more children. The whole collection forms what is technically named a 'directed acyclic [[graph]]'. When drawn out schematically, with the single root element at the top, the first-generation children on the layer immediately below the root, and so on, it resembles a conifer tree, hence the name.
+
A '''tree''' is a way of structuring a collection of data items. It starts with a '''root'''' element, which has to be found by some external (to the data collection) means. From there on, each element contains [[pointer]]s to one or more '''children''', each of which similarly has one or more children. The whole collection forms what is technically named a 'directed acyclic [[graph]]' ('acyclic' meaning without cycles/loops; i.e. from the root, there is only a ''single'' path to ''any'' leaf element). When drawn out schematically, with the single root element at the top, the first-generation children on the layer immediately below the root, and so on, it resembles a conifer tree, hence the name.
  
 
[[Category: Basics]]
 
[[Category: Basics]]

Latest revision as of 01:57, 14 January 2024

A tree is a way of structuring a collection of data items. It starts with a root' element, which has to be found by some external (to the data collection) means. From there on, each element contains pointers to one or more children, each of which similarly has one or more children. The whole collection forms what is technically named a 'directed acyclic graph' ('acyclic' meaning without cycles/loops; i.e. from the root, there is only a single path to any leaf element). When drawn out schematically, with the single root element at the top, the first-generation children on the layer immediately below the root, and so on, it resembles a conifer tree, hence the name.