🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.acorn.programmer
Article #21

Re: Sorting algorithms

#21
From: Paul Sprangers
Date: Mon, 16 Nov 2026 19:15
28 lines
2275 bytes
In article <11dfi5o$1l3bi$1@solani.org>,
   Sebastian Barthel <naitsabes@freenet.de> wrote:

> I don't understand what this line
> > IF dummy$(i%) < dummy$(i%-1) THEN
> does. It compares two string - OK. But what is a string "bigger" than 
> another ?

A string is 'bigger' than another if it alphabetically comes after the
other one. "Sebastian Barthel" is bigger than "Sebestian Bach"!

The point is that BASIC only looks at the ASCII value of characters for
determining the alphabetical flow. Therefore it puts 'Céline' after
'Coline', for example.

The other point was that OP's original routine takes 12.7 seconds to sort a
list of over 4000 lines and still has the 'Céline' problem, while a simple
BASIC program (okay, compiled) sorts 6000 lines without that problem in
about 3 seconds.

But of course, this simple program can be enhanced a lot further in many
ways, one of which is sorting pointers rather than strings, as you already
pointed out.

Paul

-- 
https://riscos.sprie.nl
Technical Details
Message-ID: <5d38c72b71Paul@sprie.nl>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <5d336712aebob@sick-of-spam.invalid> <5d3622ac84Paul@sprie.nl> <5d3628e1b7News04@avisoft.f9.co.uk> <5d362f6206Paul@sprie.nl> <11dfi5o$1l3bi$1@solani.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Paul Sprangers <Paul@sprie.nl>
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Sorting algorithms
Date: Mon, 16 Nov 2026 20:15:54 +0100 (Custom)
Organization: None
Lines: 28
Message-ID: <5d38c72b71Paul@sprie.nl>
References: <5d336712aebob@sick-of-spam.invalid> <5d3622ac84Paul@sprie.nl>
	<5d3628e1b7News04@avisoft.f9.co.uk> <5d362f6206Paul@sprie.nl> <11dfi5o$1l3bi$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 16 Nov 2026 19:16:21 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="4034513"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19GqOurpxIHK9rXbEd/U0LL3MbBibU3NQw="; posting-host="72abda0a5abe546baede8b55762eae1c"
User-Agent: Pluto/3.20 (RISC OS/5.31) NewsHound/v1.54
Cancel-Lock: sha1:wXMBc14/WNbc3wAxNNvHXJeXKLQ= sha256:g+5hdqxqq3y6xYzyWHUBGN+S5LTl1uAquRLS/De/V5Q=
	sha1:IVOWNHrGaSsxo3fqusotkg1gYa0= sha256:PMbBrnoXZlGH7LIigbHg5kOeyeJqa88kZKO/FvUP6Ns=