Iterators for D
    Karen Lanrap 
    karen at digitaldaemon.com
       
    Mon Nov  6 21:41:58 PST 2006
    
    
  
Walter Bright wrote:
> there's no way to efficiently 'linearize' a binary tree
In the general case the structure to be linearized is a directed 
graph. Every linearization has to at least implicitely build a 
spanning tree for that graph.
A priori in spanning trees the number of childs of a node is limited 
only by the number of nodes of the structure.
Therefore every linearizator must be able to handle trees of 
arbitrary degree.
>From tree grammars it is known, that top down attributions and bottom 
up attributions are incomparable to each other when only one run is 
allowed.
Because the goal of any linearization is to compute some attribution 
of the structure every 'traverser' must assist the process outlined 
above, where in the general case more than one run is needed.
Now: what is efficiency in this general case? 
    
    
More information about the Digitalmars-d
mailing list