Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Improve my sort! Date: Sat, 04 Nov 2017 23:12:32 +0000 Organization: A noiseless patient Spider Lines: 39 Message-ID: <871sld63kv.fsf@bsb.me.uk> References: <29745427-ec33-4eea-b8ac-e72ef8b416de@googlegroups.com> <46960de0-26e1-4f9d-9631-e91b0ace5b38@googlegroups.com> <87o9oh6bgp.fsf@bsb.me.uk> <4ec9d774-4d48-468c-bed1-657b7bf325cb@googlegroups.com> <877ev566jc.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="58b29a83772816312a7f7c2107735557"; logging-data="25507"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ej4LCl/CLF0jkdbG+RPbbhuA1Kv3dTFQ=" Cancel-Lock: sha1:95gq7pAuzIkWZ/d6fi9vVQ9ZYes= sha1:BQs6FClsjm2PUOOk8JXnvOIuDAA= X-BSB-Auth: 1.6a5fc236a45f26a1ce15.20171104231232GMT.871sld63kv.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:34302 jonas.thornvall@gmail.com writes: > Den lördag 4 november 2017 kl. 23:08:51 UTC+1 skrev Ben Bacarisse: >> jonas.thornvall@gmail.com writes: >> >> > Den lördag 4 november 2017 kl. 21:22:20 UTC+1 skrev Ben Bacarisse: >> >> jonas.thornvall@gmail.com writes: >> >> >> >> > When i said improve my sort i meant the speed, not the syntax. >> >> >> >> The algorithm is not yet correct. You have a bug (a different one) when >> >> start is > 0. >> >> > No Ben the algorithm works just fine unless you refer to the input max >> > value being -1, it is the random generator bug as you said. Not the >> > sorting algorithm. The result is the same using javascript sort or >> > quicksort. >> >> Here's a screen short showing incorrect results: >> >> http://bsb.me.uk/tmp/jt-sort.png > > Well if you were intelligen you would understand it depends on the > initialisation of arrays. > > Option 1. Try run the rng separated from the sort, you think you could > manage do that change? > > Option 2. Press the button a second time you think your old hand could > take it without it causing extreme pain? This display does not change. That's because there is a bug in the code. I really don't mind if you don't believe me. Option 3 is to fix the bug. That's what I did in the version I used to compare times. -- Ben.