Next in thread → Next in month →

Re: [xml-dev] Representing binary trees in XML … flat versus recursive

From
John Cowan <>
To
"Costello, Roger L." <>
Date
2019-07-04T18:36:12Z
ID
<>
Thread
Re: [xml-dev] Representing binary trees in XML … flat versus recursive


On Thu, Jul 4, 2019 at 2:20 PM Costello, Roger L. <[email protected]> wrote:
 

Sorry, I am not clear on what you are suggesting. Do you mean this (recursive) design:


Yes. that's it. You can dispense with binary-tree as well and just use root-node.
 

That doesn’t reduce the number of levels in the tree.


I think it does.  Your design has node as the sole child of left-child and right-child. I am just talking about merging their functions into a single element, one that says it is a node *and* which child it is.  If you knew there would never be any nodes with just one child, you could use just node elements and let ordering do the work (left first, right second), but that limits the applicability.


John Cowan          http://vrici.lojban.org/~cowan        [email protected]
With techies, I've generally found
If your arguments lose the first round
Make it rhyme, make it scan / Then you generally can
Make the same stupid point seem profound!           --Jonathan Robie

Next in thread → Next in month →