Re: Create a string with (n) copies of the same character



In microsoft.public.scripting.jscript message <uerSa2s$HHA.3916@TK2MSFTN
GP02.phx.gbl>, Mon, 24 Sep 2007 12:08:59, Dave Anderson
<NPQRWPDWZGSP@xxxxxxxxxxxxx> posted:
"Dr J R Stockton" wrote:
For shortish strings, yours is faster. For longish strings,
mine is much faster...

Isn't that assessment entirely implementation-dependent?

No. Not entirely.

[O(N) discussion trimmed]

That only addresses your second assertion. I agree that yours is O(log
N). No need to specify base 2, as I'm sure you know.


Indeed; I was only refuting the "entirely".

You can do your own tests, in your browsers, with
<URL:http://www.merlyn.demon.co.uk/js-tests.htm#Speed>, Big String
Speed.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt> RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.
.


Loading