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

Re: Duplicates in a sequence ?

Subject: Re: Duplicates in a sequence ?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Mar 2015 11:09:18 -0000
Re:  Duplicates in a sequence ?
> I agree the above is O(n^2) with no duplicates. However I wonder how
distinct-values is implemented with Saxon that you say it is O(n log n). What
intrigues me is that the order does not change on Oxygen 16.1.
>

Saxon's implementation of distinct-values($input) is basically:

HashSet set = new HashSet();
for each x in $input
  if (!set.contains(x)) {
    set.add(x);
    result.add(x);
  }
}

except that the code is inverted to make it streamable.

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.