Menu
  • HOME
  • TAGS

All elements order in XML preorder and postorder traversal in c#

c#,xml,preorder,postorder

So handling a pre-order tree traversal is the easier of the two, so we'll start there. The method will accept a sequence of items, and a function that accepts an item and translates it into a sequence of items, this lets us get all children for any given node. Then...

Finding deepest node in a tree (Lisp)

tree,lisp,common-lisp,tree-traversal,postorder

I just figured that you have to call tree-depth not postorder. Though the answer basically stays the same: As soon as you use trace to get the call-tree: (trace tree-depth) (tree-depth '(1 (2 (4) (6)) (5 (7) (8)))) 0: (TREE-DEPTH (1 (2 (4) (6)) (5 (7) (8)))) 1: (TREE-DEPTH (2...