[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Exchanging trees



How can I exchange two arbitrary subtrees of the same tree, i.e.

	exchange-tree : TREE1, TREE2 -> WHATEVER

regardless of their relative position within the surrounding tree.

Annotations of both of the trees also have to be swapped around:


	    /\ 		              /\
           /  \   exchangeex-tree    /  \
	  /    \  --------------->  /    \
	 /x____y\	           /x____y\
	  |    |  	            |    |
       a1-T1   T2-a2	         a2-T2   T1-a1

Thanks for any hint

		Guido