Skip to content
Prev 247056 / 398503 Next

list concatenation

Lists are (isomorphic to) trees with (possibly) labelled nodes. A
completely general solution in which two trees have possibly different
topologies and different labels would therefore involve identifying
the paths to leaves on each tree, e.g. via depth first search using
recursion, and unioning leaves with the same paths (which could be
quickly found in R via match() on the paths). This is a standard
exercise in a data structures course.

Considerable simplification could be effected if tree topologies
and/or labels are identical or have other restrictions on them.
However, you have not made it clear in your post whether this is the
case (it is in your example).

-- Bert
On Tue, Jan 11, 2011 at 8:04 AM, Joshua Wiley <jwiley.psych at gmail.com> wrote: