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 22:08:39 +0000 Organization: A noiseless patient Spider Lines: 21 Message-ID: <877ev566jc.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> 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="32419"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qmPyqIcLr4JPTA5/NCxwAeujnIGvLBkY=" Cancel-Lock: sha1:w0q8zVVUOauvC06qAPCzRKZ38QY= sha1:2lnLrS3bGSrTsDt5WtsqIWGdU7s= X-BSB-Auth: 1.db7a072925a17bf06b45.20171104220839GMT.877ev566jc.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:34297 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 -- Ben.