> > Concerning performance: I am afraid that the solutions Ken > came up with were not very optimized for large sequences. > They have a logarithmic complexity. Let me provide a solution > that has a linear complexity: > > Shouldn't that be exponential... logarithmic is better than > linear isn't it? :)
Yeah, I actually meant complexity roughly matching n * log n (+ some more) for Ken's approach versus 2 * n for mine. But it is not entirely fair. My solution includes sorting which usually adds a log n as well. I would be interested in some measurements, but lack the data to do them myself.. Kind regards, Geert drs. G.P.H. (Geert) Josten Consultant Daidalos BV Hoekeindsehof 1-4 2665 JZ Bleiswijk T +31 (0)10 850 1200 F +31 (0)10 850 1199 mailto:[email protected] http://www.daidalos.nl/ KvK 27164984 P Please consider the environment before printing this mail. De informatie - verzonden in of met dit e-mailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
