xsl-list
[Top] [All Lists]

Re: how to optimize recursive algorithm?

2003-11-27 14:01:26
This is a feature of Saxon 7.x, isn't it?
I am using 6.5.3, sigh!

Thanks,
Flavio


----- Original Message ----- 
From: "Michael Kay" <mhk(_at_)mhk(_dot_)me(_dot_)uk>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Thursday, November 27, 2003 19:06
Subject: RE: [xsl] how to optimize recursive algorithm?


If you work forwards through the list, you can pass the computed values
onwards as parameters rather than recomputing them each time, which
should make the algorithm O(n) rather than O(n^2).

If you prefer, you can get the caching effect by using memoized
functions in Saxon (saxon:memo-function="yes"), but you have to ask for
this explicitly.

Michael Kay



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list