Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #6721

Sorting algorithms

From Bob Latham <bob@sick-of-spam.invalid>
Newsgroups comp.sys.acorn.programmer
Subject Sorting algorithms
Date 2026-11-06 08:45 +0000
Organization None
Message-ID <5d336712aebob@sick-of-spam.invalid> (permalink)

Show all headers | View raw


A music library scan tool I've written produces a list of over 4000
lines, each line shows the path to a particular album. But the filer
does not list in alphabetic order...

There are two sort types I understand; Bubble sort and what I call
"Best So Far" but I bet there is a different official name.

I've always gone for bubble sort for two reasons, firstly I
understand the principle and it does not require another chunk of ram
to hold the result file. But using this method takes 12.6 seconds.

The "Best So Far" method is to repeatedly pass through the source
file and pick out the best line on each pass and move it out to
another store and mark it as used in the source. I had the idea of
squirting these best lines one at a time to a file on disc rather
than provide temporary ram.

I realised that using OS_BPut, line by line was not going to be as
fast as saving a file in one go but tried it anyway. It took 6
seconds. Faster yes but I don't like it, the sorted file never exists
in the application. True it doesn't matter but it kind of does to me.

Anyone got any suggestions for a better approach? Something I might
even understand?

A slight complication, any sort would need to handle is the Céline
Dion problem. I like treating é as e as regards the sort comparison
stage.

Also, how is StrongEd so lightning fast on sorts? It barely blinks.


Still coded in Basic Assembler, in case you need to know. 


Thanks.

Bob.

Back to comp.sys.acorn.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Sorting algorithms Bob Latham <bob@sick-of-spam.invalid> - 2026-11-06 08:45 +0000
  Re: Sorting algorithms Jean-Michel <jmc.bruck@orange.fr> - 2026-11-06 17:30 +0100
    Re: Sorting algorithms Bob Latham <bob@sick-of-spam.invalid> - 2026-11-06 17:57 +0000
      Re: Sorting algorithms Jean-Michel <jmc.bruck@orange.fr> - 2026-11-06 20:28 +0100
  Re: Sorting algorithms Paul Sprangers <Paul@sprie.nl> - 2026-11-07 13:36 +0100
    Re: Sorting algorithms Jean-Michel <jmc.bruck@orange.fr> - 2026-11-07 18:55 +0100
      Re: Sorting algorithms Paul Sprangers <Paul@sprie.nl> - 2026-11-07 19:41 +0100
        Re: Sorting algorithms Martin <News04@avisoft.f9.co.uk> - 2026-11-07 19:48 +0000
          Re: Sorting algorithms Bob Latham <bob@sick-of-spam.invalid> - 2026-11-08 12:13 +0000
  Re: Sorting algorithms Paul Sprangers <Paul@sprie.nl> - 2026-11-11 17:06 +0100
    Re: Sorting algorithms Martin <News04@avisoft.f9.co.uk> - 2026-11-11 17:14 +0000
      Re: Sorting algorithms Paul Sprangers <Paul@sprie.nl> - 2026-11-11 19:25 +0100
        Re: Sorting algorithms Sebastian Barthel <naitsabes@freenet.de> - 2026-11-16 18:31 +0000
          Re: Sorting algorithms Paul Sprangers <Paul@sprie.nl> - 2026-11-16 20:15 +0100
            Re: Sorting algorithms Bob Latham <bob@sick-of-spam.invalid> - 2026-11-17 09:11 +0000
              Re: Sorting algorithms Matthew Phillips <spam2011m@yahoo.co.uk> - 2026-11-25 20:05 +0000
                Re: Sorting algorithms Bob Latham <bob@sick-of-spam.invalid> - 2026-11-25 21:07 +0000
                Re: Sorting algorithms Jean-Michel <jmc.bruck@orange.fr> - 2026-11-26 12:50 +0100
                Re: Sorting algorithms Harriet Bazley <harriet@bazleyfamily.co.uk> - 2026-11-26 22:32 +0000
                Re: Sorting algorithms Martin <News04@avisoft.f9.co.uk> - 2026-11-26 23:16 +0000
          Re: Sorting algorithms Martin <News04@avisoft.f9.co.uk> - 2026-11-16 19:17 +0000
    Re: Sorting algorithms Jean-Michel <jmc.bruck@orange.fr> - 2026-11-11 20:36 +0100
      Re: Sorting algorithms Paul Sprangers <Paul@sprie.nl> - 2026-11-11 22:55 +0100

csiph-web