[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

In fact it's linear! (Was: Re: Summary/Performance/Add

Subject: In fact it's linear! (Was: Re: Summary/Performance/Add Q: convert flat list w/ level information to a hierarcial one?)
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 3 Dec 2003 05:42:13 -0800 (PST)
it s linear
> thanks to Michael Kay, I have discovered that however expressions in the
> Dimitre's algorithm lead to exponential time, they are incorrect. I hope
> that this corrected version of Dimitre Novachev's algorithm both 
> produces the correct result and has quadratic time. The changes are 
> around line the second following-sibling:: expression.

David,

Thank you very much for the correction.

I ran the transformations and now am getting the following results in
milliseconds:

No. nodes    David's        Dimitre's (with David's correction)
==============================================================
      100      15 -   40              4.5 -   6

      200      48 -   80              7.6 -   9.126

      400     114 -  180             16   -  23 

      800     442 -  673             32   -  57

     1600    1207 - 1791             66   - 105

     3200     Stack Overflow        142   - 233

In fact, this transformation exhibits linear runtime behaviour!

As for the potential problem with your transformation -- it is obvious
from the results.


Thank you once again. I am glad that I was right to prefer the more simple
algorithm -- isn't small beautiful?  :o)




 


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.