RE: sort-in-tree-order

Subject: RE: sort-in-tree-order
From: Avi Kivity <Avi@xxxxxxxxxxxxx>
Date: Sun, 31 Jan 1999 19:08:50 +0200
On Friday, January 29, 1999 18:35, Tony Graham
[SMTP:tgraham@xxxxxxxxxxxxxxxx] wrote:
> Does anyone have a working implementation of sort-in-tree-order and
> ancillary functions?  As copied from the standard, it merely failed,
> 
> and now I have achieved infinite processing time, so any help would
> be
> appreciated.

If you're willing to sort elements only, and use jade-only extensions, you
could use a quicksort with a compare based on (all-element-number), say
(lambda (n1 n2) (< (all-element-number n1) (all-element-number n2)))

If you want non-elements, you may have to walk up the ancestor list until an
element is found, use (all-element-number) for the easy case (unequal
all-element-numbers), and a linear search in case both nodes are in the same
element. It wouldn't be fun, but it should be more efficient than the
example in the standard.

Hope this helps,

Avi


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • sort-in-tree-order
    • Tony Graham - Fri, 29 Jan 1999 11:46:13 -0500 (EST)
      • <Possible follow-ups>
      • Avi Kivity - Sun, 31 Jan 1999 12:17:29 -0500 (EST) <=