They are both O(n^2).
Only in the worst case though isn't it, which is a list of
unique values?
It's actually O(n*m) where n is the number of values and m the number of
distinct values. So it's O(n^2) in any case where the number of distinct
values is proportional to the size of the population, which means in effect
in any "open-ended" population.
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--